All Projects → douglarek → zerodown

douglarek / zerodown

Licence: MIT License
Graceful restart & zero downtime deploy for Go servers.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to zerodown

lifecycle-manager
Graceful AWS scaling event on Kubernetes using lifecycle hooks
Stars: ✭ 89 (+147.22%)
Mutual labels:  graceful-shutdown
http-graceful-shutdown
Gracefully terminates HTTP servers in Node.js
Stars: ✭ 79 (+119.44%)
Mutual labels:  graceful-shutdown
breaker
🚧 Flexible mechanism to make execution flow interruptible.
Stars: ✭ 100 (+177.78%)
Mutual labels:  graceful-shutdown
sigctx
Go contexts for graceful shutdown
Stars: ✭ 55 (+52.78%)
Mutual labels:  graceful-shutdown
node-graceful-shutdown
Gracefully shutdown your modular NodeJS application.
Stars: ✭ 20 (-44.44%)
Mutual labels:  graceful-shutdown
hiatus-spring-boot
No description or website provided.
Stars: ✭ 23 (-36.11%)
Mutual labels:  graceful-shutdown
kms
🔪 Is a library that aids in graceful shutdown of a process/application
Stars: ✭ 44 (+22.22%)
Mutual labels:  graceful-shutdown
python-graceful-shutdown
Example of a Python code that implements graceful shutdown while using asyncio, threading and multiprocessing
Stars: ✭ 109 (+202.78%)
Mutual labels:  graceful-shutdown

zerodown Build Status

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.go

  1. 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].