• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

rcrowley/goagain: Zero-downtime restarts in Go

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

rcrowley/goagain

开源软件地址:

https://github.com/rcrowley/goagain

开源编程语言:

Go 92.3%

开源软件介绍:

goagain

Zero-downtime restarts in Go

The goagain package provides primitives for bringing zero-downtime restarts to Go applications that accept connections from a net.TCPListener or net.UnixListener.

Have a look at the examples because it isn't just a matter of importing the library and everything working. Your main function will have to accomodate the goagain protocols and your process will have to have some definition (however contrived you like) of a graceful shutdown process.

Installation

go get github.com/rcrowley/goagain

Usage

Send SIGUSR2 to a process using goagain and it will restart without downtime.

example/single/main.go: The Single strategy (named because it calls execve(2) once) operates similarly to Nginx and Unicorn. The parent forks a child, the child execs, and then the child kills the parent. This is easy to understand but doesn't play nicely with Upstart and similar direct-supervision init(8) daemons. It should play nicely with systemd.

example/double/main.go: The Double strategy (named because it calls execve(2) twice) is experimental so proceed with caution. The parent forks a child, the child execs, the child signals the parent, the parent execs, and finally the parent kills the child. This is regrettably much more complicated but plays nicely with Upstart and similar direct-supervision init(8) daemons.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
zzdboy/GoCMS: 基于Revel,Jquery, Xorm开发的内容管理系统发布时间:2022-06-13
下一篇:
justinas/alice: Painless middleware chaining for Go发布时间:2022-06-13
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap