socketmaster: Zero Downtime Restart for Your Apps
I have just released yet another Open-Source project. This was gracefully sponsored by PandaStream, so I thought I might as well post here. Let me introduce you to socketmaster.
In the tradition of UNIX, socketmaster does just one thing but does it well; it helps your app to restart without losing or refusing a single connection. socketmaster is the gatekeeper, keeping your sockets warm under the fire of restarts (christmas starts sooner every year isn’t it ? ho ho ho!).
To port your app to socketmaster you just need to do two things:
- Change the startup code to open the file-descriptor 3 as a socket listener.
- Gracefully shutdown on SIGHUP.
socketmaster will then take care of the rest for you. To get a better example of how it works, the example folder in the project’s source tree has a Go and ruby example as well as an upstart script for you: https://github.com/pandastream/socketmaster/tree/master/examples .
The tool is written in Go which allowed me to shorten my development time considerably compared to C. Go allowed me to tap into the lower-level POSIX constructs while also having access to handy higher-level abstractions. For you, it means that it can easily be cross-compiled and distributed in a binary form.
Panda is now using socketmaster in production. Needless to say, you can count on it to be supported. If you find any bugs, want to contribute or send pull-requests, just get in touch and I’ll respond quickly.
PS: Are you a hacker looking for a job in London ? We’d like to meet you and make you part of our team. http://pandastream.com/jobs