I have a dozen or so Django-powered sites running in a modwsgi setup using
two WSGIProcessGroups (depending on the timezone required -- UTC/local).
This is working very well -- thank you :)

I discovered an issue yesterday however, when I began doing some image
processing using PIL <http://www.pythonware.com/library/pil/> -- one of the
processes jumped from using 30MB to 150MB of RAM. It does not appear to be a
memory *leak *as such, and does not increase much beyond this with
repetition, but just loading the relevant libraries, etc. This would be fine
except that I have so far existed very happily running all these sites from
within my modest 80MB (RAM) WebFaction
account<http://www.webfaction.com/services/hosting?affiliate=meers>,
and hogging this much RAM for too long will cause my processes to be killed
(and rightly so).

This morning I discovered the handy maximum-requests and
inactivity-timeoutWSGIDaemonProcess
options<http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess>,
which do a pretty good job of ensuring that the processes get restarted
regularly enough to avoid being killed.

However I'm wondering if there is a better way of handling this; rather than
waiting for inactivity or a certain number of requests, it would be nice to
be able to cleanly restart the process when the resource usage breached a
predefined threshold. I could not find any such option in the documentation;
I don't think that
stack-size<http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess>is
quite what I'm after? I could run a cron job to monitor the RAM usage
and
issue apache stop/start commands, but this seems to lead to a brief period
of  "Service Temporarily Unavailable" status during the process.

The image processing tasks are performed occasionally by administrators, not
during general use of the site.

Any suggestions?

Also, is there a way of seeing a memory usage breakdown to pinpoint problem
areas?

Cheers,
Simon

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to