Supervisor is only capable of monitoring processes which it runs directly; it
cannot monitor processes that are forked off by subprocesses.  Your
configuration looks good otherwise.  I don't know how to make Varnish not fork a
subprocess; you might ask on the Varnish list.

Harald Friessnegger wrote:
> hi there
> 
> i'm using supervisor for controlling a zope server and varnish cache in a 
> python buildout (this is why some configuration options might look different 
> from what you're used to)
> 
> monitoring and restarting varnish with memmon does not work out of the box.
> 
> varnish does not get restarted, since the process really eating memory (pid
> 13271)
> is not the one started by supervisor and observerd by MemmonVarnish (13265)
> (see supervisor and top output below)
> 
> how can i make Memmon watch vanish sub-processes or varnish not fork any
> processes?
> 
> 
> regards, fRiSi
> 
> 
> 
>   # bin/supervisorctl
>   MemmonVarnish         RUNNING    pid 13261, uptime 1 day, 4:37:05
>   MemmonZope            RUNNING    pid 13260, uptime 1 day, 4:37:05
>   varnish               RUNNING    pid 13265, uptime 1 day, 4:37:02
>   zeo                   RUNNING    pid 13262, uptime 1 day, 4:37:04
>   zope                  RUNNING    pid 13263, uptime 1 day, 4:37:03
>   
>   # top
>   ...
>   Mem:   1548288k total,  1540624k used,     7664k free,     2172k buffers
>   Swap:  1048568k total,   767628k used,   280940k free,   171980k cached
>   13271 nobody    15   0 1864m 771m  90m S    0 51.0   0:14.43 varnishd
>   13263 zope      15   0  635m 454m 3500 S    0 30.1  47:59.16 python2.4
>   13265 root      15   0 98192  81m  80m S    0  5.4   0:00.04 varnishd
>   13262 root      16   0  109m  12m 2772 S    0  0.8   0:50.06 python2.4
>   ...
> 
> 
> 
> 
> 
> varnish is started by supervisor with these parameters
> 
> exec ...parts/varnish-build/sbin/varnishd \
>     -f "...etc/varnish.vcl" \
>     -P "...parts/varnish/varnish.pid" \
>     -a localhost:6181 \
>     -T localhost:6182 \
>     -s file,"...parts/varnish/storage",500M \
>     -F \
>     -t 0 "$@"
> 
> 
> the supervisor section for varnish and memmon-varnish looks like this
> 
> [program:varnish]
> command = ...bin/varnish
> process_name = varnish
> directory = ...bin
> priority = 30
> redirect_stderr = true
> 
> [eventlistener:MemmonVarnish]
> command = ...bin/memmon -p varnish=600MB
> events = TICK_60
> process_name=MemmonVarnish
> environment=SUPERVISOR_USERNAME=admin,SUPERVISOR_PASSWORD=admin,SUPERVISOR_SERVER_URL=http://localhost:9001
> 
> 
> 
> 
> 
> 
> buildout configuration:
> 
>   [varnish]
>   recipe = plone.recipe.varnish:instance
>   daemon = ${buildout:directory}/parts/varnish-build/sbin/varnishd
>   bind = localhost:6181
>   config = ${buildout:directory}/etc/varnish.vcl
>   cache-size = 500M
>   telnet = localhost:6182
>   # foreground is needed for supervisor to control varnish correctly
>   mode = foreground
> 
> 
>   [supervisor]
>   recipe = collective.recipe.supervisor
>   programs =
>       10 zeo ${zeoserver:location}/bin/runzeo ${zeoserver:location} true
>       20 zope ${instance:location}/bin/runzope ${instance:location} true
>       30 varnish  ${buildout:directory}/bin/varnish  true  
>   eventlisteners =
>       MemmonZope TICK_60 ${buildout:bin-directory}/memmon [-p zope=1000MB]
>       MemmonVarnish TICK_60 ${buildout:bin-directory}/memmon [-p
> varnish=600MB]
> 
> 

_______________________________________________
Supervisor-users mailing list
[email protected]
http://lists.supervisord.org/mailman/listinfo/supervisor-users

Reply via email to