TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Self-hosted application devs how do you handle deployment downtimes?

3 点作者 CloseChoice超过 1 年前
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?

4 条评论

stephenr超过 1 年前
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&#x27;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&#x27;t bother with &quot;scheduled&quot; maintenance like you&#x27;re talking about.<p>If it&#x27;s something especially complex, `$CLIENT` has sometimes announced the outage to customers ahead of time on social media, but this isn&#x27;t very common.
sgt超过 1 年前
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.
fragmede超过 1 年前
Why would you go down for deploys? That&#x27;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.
t312227超过 1 年前
hello,<p>idk what &quot;deploying&quot; 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 &quot;location&quot; - 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 &amp; 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€