3 ms·
Think of circus as a more modern and intelligent version of xinetd. It binds to the socket and then hands off requests to the workers. Here is why this is aweso
by SEJeff 13y ago
Think of circus as a more modern and intelligent version of xinetd. It binds to the socket and then hands off requests to the workers. Here is why this is awesome...
So we use circus to maintain about a dozen apps and a few of them are django apps running under Mozilla's chaussette wsgi server. When we do an autodeploy via jenkins, jenkins will run circusctl to stop that worker, replace the code, futz a symlink, and then start the worker again. We front the apps with apache 2.4 (because it is as fast as nginx) + mod_proxy. That gives us ldap access control through apache and shiney LTSV formatted logs that tools like logstash or splunk can easily consume. We then front apache with a virtual ip provided by a tool such as keepalived for moar web scales.
For all in-flight requests, they will just hang as circus proper will hold onto the connection keeping the socket open. It will pass the socket to the first worker started once it is restarted. So during a deploy, a request might hang for a few milliseconds, but it never blows up. It is awesome in that it allows you 0 downtime deploys (at least for our django web stack it does).
Circus is a super elegant piece of software. Kudos to Mozilla for finally making a release. I'd been bugging them for awhile: https://github.com/mozilla-services/circus/issues/561 https://github.com/mozilla-services/circus/issues/561
Edit:
Example of a 0 downtime restart config using uwsgi (instead of chaussette):
https://github.com/scottkmaxwell/circus/commit/ef0000fe4ef3c09553dd8069e459754839b3673a https://github.com/scottkmaxwell/circus/commit/ef0000fe4ef3c...