- How to start and stop Plone instances
- How to deal with Plone instances that run away with memory
- How to restart Plone processes that have died
The solution
Well I believe that I've found the solution, and it goes by the name of "Supervisord" and the fun slogan "hang on to your processes". As a bonus, it is python based, installs nicely via easy_install and newer versions of ZopeSkel's plone_hosting template now ship with a supervisord configuration.
A recipe
In short, with a few deft strokes of the keyboard, I can have my Plone and supervise it. My recipe goes something like this:
1. Get the latest ZopeSkel
easy_install ZopeSkel
2. Install Plone hosting (I'll call my directory "usain").
paster create -t plone_hosting
3. Add lines similar to this to my crontab (by running crontab -e)
@reboot /home/plone/usain/bin/supervisord -c /home/plone/usain/etc/supervisord.conf
4. For good measure add a line like this to my supervisord.conf file:
[eventlistener:memmon]If any supervised processes run over 200MB of resident memory usage for more than 60 seconds, supervisor will restart them.
command=%(here)s/../bin/memmon -a 200MB -m bob@example.com
events=TICK_60
No comments:
Post a Comment