Run more than one copy of an app
Copies run the same app more than once behind its one address, so one that crashes does not take the others with it. Each copy takes memory, so your server decides how many you can have.
Turning copies on
Open your app, then Settings, and find Copies. Choose a number under Copies running, then press Save or Save and apply now.
Saveonly stores the number. Nothing that is running changes, and it applies from the app's next deploy. Save and apply now deploys the app straight away.
How many you can have
Two to five copies. Copies cost memory, not disk: each one uses as much memory as the app does on its own, so three copies use about three times as much. The card says how much memory your server has free, how much each copy needs, and how many copies fit.
- Memory is kept free for the system and your other apps: 512 MB, or a tenth of the server’s memory if that is more.
- If the app has not run long enough to be measured, or the server is out of contact, the card says so and offers no more copies.
- If you ask for more than fits, saving is refused and the card says why. Fewer copies are always allowed.
Apps that cannot have copies
- An app that keeps data on its server, such as uploads or an embedded database, runs as one copy: several would share one data folder.
- A pull-request preview runs as one copy.
- A staging copy runs as one copy; copies are for the live app.
- Only an app built from a repository, or one that runs an image you named, can have copies. An app made of several parts cannot. See Run an app made of several parts.
What visitors see
The same single address as before. A small balancer in front spreads visitors across the copies, and if one crashes the others keep answering while it restarts. For what happens when an app stops answering, see When something goes wrong.