[mod_python] max memory/time allocation

Graham Dumpleton graham.dumpleton at gmail.com
Mon Apr 21 19:06:43 EDT 2008


Please keep replies on the mailing list by using 'reply-all'.

2008/4/22 Zhukov Pavel <gelios at gmail.com>:
> so, what can i do to protect my server? only use python as cgi with
>  apache limitations?

Do be aware that the PHP options you mention are not likely to be
available in all ways that PHP can be hosted. Most likely the only
instance where they would be available is where PHP is run in a CGI
mode or single threaded FASTCGI process. This is because the shared
nature of  Apache child processes means you can't go arbitrarily go
killing off Apache child processes.

So, as of today, for Python the only option is to use CGI, possibly in
conjunction with the RLimitCPU and RLimitMEM directives.

The only other option, albeit not available today, is that if you use
mod_wsgi and its daemon mode, in the future it will be adding options
to allow memory and CPU usage to be limited. The memory limit will be
a hard limit and behaviour is undefined when it is reached. ie.,
memory allocations will start failing. For the CPU limit, a daemon
process restart will be triggered. More details of this future
mod_wsgi feature can be found at:

  http://code.google.com/p/modwsgi/issues/detail?id=21

Graham

>  On Tue, Apr 22, 2008 at 1:30 AM, Graham Dumpleton
>  <graham.dumpleton at gmail.com> wrote:
>  > 2008/4/21 Zhukov Pavel <gelios at gmail.com>:
>  >
>  > > is mod_python support something like max_memory/max_execution_time
>  >  >   options like php?
>  >
>  >  No.
>  >
>


More information about the Mod_python mailing list