Closed GoogleCodeExporter closed 9 years ago
Original comment by Graham.Dumpleton@gmail.com
on 5 Sep 2007 at 11:41
Should probably just implement Apache RLimitCPU and RLimitMEM directive
equivalents
for daemon processes. Options would be rlimit-cpu and rlimit-mem.
For CPU limit, signal indicating soft limit reached could cause orderly restart
of
daemon process. This would help in blocking run away processes.
For MEM limit, no signal available, so all that would happen is that memory
allocations would start failing. Would need to make sure mod_wsgi at least
handles
this gracefully in all cases. Currently may not check all returns form memory
allocating operations properly.
Original comment by Graham.Dumpleton@gmail.com
on 26 Mar 2008 at 11:34
No need to implement equivalents to these Apache directives, the actual values
associated with these Apache
directives can actually be used by querying them out of core module config.
This is how mod_cgi/mod_cgid
work. The values should probably be applied in daemon process just prior to
dropping root privileges.
Original comment by Graham.Dumpleton@gmail.com
on 16 Apr 2008 at 11:02
If value of Apache directives used, can only grab it from either main server
context or virtual host context. For
CGI scripts it can also be defined in Directory or .htaccess context, but this
doesn't make sense for mod_wsgi
as daemon processes love longer than a single request. As such, memory limit
may actually need to be much
more than what one may define for a single request. The cpu limit would also
likely need to be substantially
more. Thus, specific options for WSGIDaemonProcess probably more appropriate
after all.
Because the directive actually take one or two arguments, need to somehow allow
that with
WSGIDaemonProcess options. Because hard to have spaces in options for
WSGIDaemonProcess, use a
separator such as '/' instead. Thus might have:
rlimit-cpu=120/150 rlimit-mem=134217728/max
Original comment by Graham.Dumpleton@gmail.com
on 16 Apr 2008 at 11:16
Original comment by Graham.Dumpleton@gmail.com
on 17 Jul 2008 at 1:52
Been suggested that setrlimit() for RLIMIT_RSS doesn't work on Linux since
2.4.30. See discussion:
http://groups.google.com/group/modwsgi/browse_frm/thread/10aa3a607b40d67b?hl=en
This may make adding such a feature pointless.
Original comment by Graham.Dumpleton@gmail.com
on 4 Sep 2008 at 11:14
Added cpu-time-limit option to WSGIDaemonProcess directive in revision 1224 of
trunk for mod_wsgi 3.0.
Original comment by Graham.Dumpleton@gmail.com
on 10 Mar 2009 at 10:57
Original comment by Graham.Dumpleton@gmail.com
on 10 Mar 2009 at 11:07
Because adding a limit on resident memory doesn't work at all on many Linux
kernel versions, not bothering with
implementing memory limits. Will create a separate issue for that in the future
if way determined of enforcing
limits.
Original comment by Graham.Dumpleton@gmail.com
on 10 Mar 2009 at 11:08
Version 3.0 of mod_wsgi now released wuth cpu-time-limit option for
WSGIDaemonProcess.
Original comment by Graham.Dumpleton@gmail.com
on 22 Nov 2009 at 2:48
Original issue reported on code.google.com by
Graham.Dumpleton@gmail.com
on 10 Aug 2007 at 6:08