Easily configure a performant, secure, and stable NGINX server.Learn More
Best way to have multiple instances of application running concurrently?
Currently, I’m using a single droplet (Ubuntu Dokku 0.17.9 on 18.04, 3GB Memory, 50GB Disk), which contains 1 instance of my application, plus an old staging site, each on 1 Docker container each. We have a CI/CD pipeline with Github and CircleCI - any merge to master branch will trigger a new build and deploy.
The main application is a website, and we’re still in the early stages of the business, so there isn’t too much traffic at the moment, though we’re expecting more and more visitors over the next few months.
Every so often, the site goes down, which requires one of the team to restart it through a
dokku ps:restart command, which isn’t ideal. I’m hoping to find the most efficient and simple way to have at least 2 instances of the application running at any one time, and probably a load balancer too to direct traffic into either container, so hopefully our end users will not notice anything if there’s ever a time when the site goes down.
Some options that I’ve come up with so far are:
Having a second Droplet on DigitalOcean containing the exact same application / container as my current droplet, and then setting up a D.O. Load Balancer to distribute traffic between the 2 droplets.
Having a second container running on the current droplet and setting up a Load Balancer inside the droplet (have a third container with nginx load balancer? Is there another way?)
Migrating to Kubernetes and using a managed Kubernetes solution
The big issue with 1. is that it seems extremely complicated to set up a workflow where both droplets / instances of the application would be updated at the same time when deploying a new build. I may well be missing something here that would make this process easier / doable…
For 3, we are definitely planning to move to Kubernetes at some point, but aren’t sure it’s worth taking up developer time at this stage to set it up.
So, 2 seems like it would be the best, and easiest, short-term solution, if it’s indeed possible.
I would greatly appreciate any advice or pointers on this, as it’s pretty unfamiliar territory for me, and I want to make sure it’s done in a sustainable and efficient way!
Thank you for your help!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×