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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Zero-downtime restarts in Go

141 点作者 neeee大约 12 年前

8 条评论

lbarrow大约 12 年前
We used this for a while at Braintree. It works great for Unicorn-style restarts, but it doesn't ensure that the server shuts down gracefully.<p>So while you'll have uninterrupted connectivity, if you don't ensure that your server shuts down gracefully, you'll still drop the requests that the old process is servicing when the restart is triggered. We wrote a library called manners for managing the graceful shutdown of a single server: <a href="https://github.com/braintree/manners" rel="nofollow">https://github.com/braintree/manners</a>. When used in conjunction with manners, GoAgain provides zero-downtime restarts without any dropped requests.<p>(Manners is still under development, so make sure you understand it before using it.)<p>We had an interesting experience with Go. We ended up deciding the language was not a great fit for our needs right now, in part because the community is still pretty immature. (You can read about our experiences here: <a href="https://braintreepayments.com/braintrust/gotchas-irritants-and-warts-in-go-web-development" rel="nofollow">https://braintreepayments.com/braintrust/gotchas-irritants-a...</a>).<p>Still -- as more and more libraries like this get released and stabilized, Go will become an increasingly interesting option for developers.
评论 #5438893 未加载
kkowalczyk大约 12 年前
I run 3 websites written in Go (<a href="http://blog.kowalczyk.info/article/uvw2/Thoughts-on-Go-after-writing-3-websites.html" rel="nofollow">http://blog.kowalczyk.info/article/uvw2/Thoughts-on-Go-after...</a>)<p>Those are clearly not Facebook scale servers but for majority of people: you don't need this or any other such solution.<p>Here's what I do for deployment. I have a fabric script that:<p>- copies the new executable to the server - kills currently running executable - starts the new executable<p>The worst that can happen is that a few connections will get dropped and that's perfectly fine 99.9% of websites. You don't control internet so the users will get broken connections all the time for reasons you can't eliminate. They shrug and hit reload button.<p>Complicating things to avoid few seconds of downtime was not worth it for me and rationally, probably not worth it for most.
评论 #5439637 未加载
thibaut_barrere大约 12 年前
If you deployed Go in production, I'd love reading about that since I'm having a closer look at it now (coming from Ruby). Is there a more widely used option currently?
评论 #5438501 未加载
评论 #5440616 未加载
daakus大约 12 年前
I built something similar which additionally provides graceful termination of established connections as well as systemd socket activation to (optionally) provide lazy startup of servers: <a href="https://github.com/daaku/go.grace" rel="nofollow">https://github.com/daaku/go.grace</a>
justinhj大约 12 年前
The documentation is very light so I had a look through the source code. Is the purpose of this to remotely restart a go app (that presumably has been updated and deployed) via TCP whilst keeping the TCP connection alive, or is there more to it?
voidlogic大约 12 年前
Cool, it seems like this package might work very well with this one: <a href="https://news.ycombinator.com/item?id=5443107" rel="nofollow">https://news.ycombinator.com/item?id=5443107</a>
davidw大约 12 年前
I wonder how long it will be before Go gets "enough" of Erlang to make it a suitable replacement for most people who need/want the Erlang goodies.
评论 #5441817 未加载
评论 #5441962 未加载
the_mitsuhiko大约 12 年前
What novel concept :P