Hi guys,
I am currently developing an application on a small Hetzner server. I implemented a CI workflow using Github Actions but every time I deploy I have a small downtime (approx. 2mins) and therefore I wonder: How do you handle this? Do you care about the downtime? Do you have common (announced) downtimes in which you deploy?
For `$CLIENT` everything is redundant so there are two instances (on two VMs) running the app. During most deployments, one goes offline to update; when it's done it comes back online and the other goes offline.<p>For deployments that include a database migration, both go offline to maintain data integrity, but one stays online until the actual deployment is ready to run, to reduce the window where both are offline.<p>Due to the majority of deployments being the former type (ie zero downtime), and those that have deployments being optimised to reduce the downtime, we don't bother with "scheduled" maintenance like you're talking about.<p>If it's something especially complex, `$CLIENT` has sometimes announced the outage to customers ahead of time on social media, but this isn't very common.
There are many solutions for this. Many are complex and will probably take time to implement right now, and you just want to focus on your app in the next days.<p>So if you want something super simple that will cause no downtime while switching over to a new version, just run <i>two</i> instances of your service, one on e.g port 9000 and the other on 9001.<p>At any time your proxy (nginx or traefik etc) will use only <i>one</i> of these.<p>Once you upgrade the version for the inactive one, you change the port used in nginx and reload it. Then the new version will be used.
Why would you go down for deploys? That's just wrong. One way around it is to have a load balancer that points at the old one until the new one is ready and able to serve requests, and only then does it switch over.
hello,<p>idk what "deploying" means in your case.<p>but in general: try to keep the old deployment online as long as possible and switch to the new one after validating it ...<p>eg.<p>1. deploy to a new lets call it "location" - which could be a new directory, a new set of container-images, versioned packages for your linux distro (service managed by systemd) etc...<p>2. run & validate the newly deployed service-version<p>3. switch - by certain means, heavily depended on your setup<p>this should keep the downtime within fractions of a second - if this is feasible for your application.<p>but in the end a viable solution depends on your actual deployment-process :)<p>just my 0.02€