supervisord improvements
List of changes in this MR:
-
better use of supervisord's API - we are no longer rewriting config file and letting supervisord reload it -
create Docker container -
improve performance (probably by implementing startup notifications) -
fix slow shutdown (takes exactly 10 seconds every time)
Performance
Using manager with supervisord is way slower than with systemd. Startup with systemd takes around 0.7sec on my system, while with supervisord it's nearly 4 seconds. This is caused by supervisord's method of detecting successfully started services. A process is considered started, when it is still running startsecs
seconds after startup. There is an open issue about this for 7 years. We need some kind of successful start detection, otherwise our safety measures against invalid config do not work, so we can't turn it off. Systemd has systemd-notify
, which gives us reliable way to detect successful startup faster.
This is a big problem on multi-core systems. With 32 kresd
's, a change of configuration would take more than 32 seconds. I consider this unacceptable. The solutions to this are:
- find some workaround
- patch supervisord
- implement
systemd-notify
or another way of startup notifications in manager - find a replacement for supervisord that handles this better as there is no technical reason why we couldn't use anything else
- decide, that we can ignore this
I think that patching supervisord or implementing some form of state tracking ourselves will be the way forward. Or just letting it be and fixing it later.