Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/douglarek/zerodown
Graceful restart & zero downtime deploy for Go servers.
https://github.com/douglarek/zerodown
go golang graceful-restart-process graceful-shutdown
Last synced: 2 months ago
JSON representation
Graceful restart & zero downtime deploy for Go servers.
- Host: GitHub
- URL: https://github.com/douglarek/zerodown
- Owner: douglarek
- License: mit
- Created: 2017-11-25T03:52:03.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-23T05:22:38.000Z (over 6 years ago)
- Last Synced: 2024-10-14T09:36:57.908Z (3 months ago)
- Topics: go, golang, graceful-restart-process, graceful-shutdown
- Language: Go
- Size: 4.88 KB
- Stars: 34
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
zerodown [![Build Status](https://secure.travis-ci.org/douglarek/zerodown.png)](https://travis-ci.org/douglarek/zerodown)
=====Package zerodown provides a library that makes it easy to build socket
based servers that can be gracefully terminated & restarted (that is,
without dropping any connections).Usage
-----Demo HTTP Server with graceful termination and restart:
https://github.com/douglarek/zerodown/blob/master/zerodowndemo/server.go1. Install the demo application
go get github.com/douglarek/zerodown/zerodowndemo
2. Start it in the first terminal
zerodowndemo
3. In a second terminal start a slow HTTP request
curl 'http://localhost:8080/?duration=20s'
4. In a third terminal trigger a graceful server restart:
kill -USR2 [zerodowndemo pid]
5. Trigger another shorter request that finishes before the earlier request:
curl 'http://localhost:8080/?duration=0s'
If done quickly enough, this shows the second quick request will be served by
the new process while the slow first request will be
served by the first server. It shows how the active connection was gracefully
served before the server was shutdown. It is also showing that at one point
both the new as well as the old server was running at the same time.