Python does not play well with others

Paul Boddie paul at boddie.org.uk
Mon Feb 5 13:15:12 EST 2007


On 5 Feb, 18:52, John Nagle <n... at animats.com> wrote:
>
>    Pre-forking doesn't reduce load; it just improves responsiveness.
> You still pay for loading all the modules on every request.  For
> many AJAX apps, the loading cost tends to dominate the transaction.

According to the Apache prefork documentation, you can configure how
often the child processes stick around...

http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxrequestsperchild

...and I suppose mod_python retains its state in a child process as
long as that process is running:

"Once created, a subinterpreter will be reused for subsequent
requests. It is never destroyed and exists until the Apache process
dies."
- http://www.modpython.org/live/current/doc-html/pyapi-interps.html

"Depending on the use of various PythonInter* directives, a single
python interpreter (and list of imported modules, and per-module
global variables, etc) might be shared between multiple mod_python
applications."
- http://www.modpython.org/FAQ/faqw.py?req=show&file=faq03.005.htp

The FAQ entry (3.1) about module reloading would appear to be
pertinent here, too:

http://www.modpython.org/FAQ/faqw.py?req=show&file=faq03.001.htp

Paul




More information about the Python-list mailing list