[mod_python] MemorySession and httpd processes

Alexis Marrero amarrero at mitre.org
Fri May 5 19:32:51 EDT 2006


Is there anyway that I can use mod_python.Session.MemorySession  
through the different httpd processes? I guess that the answer is no,  
but I wanted to check.

I have a process that post data multiple times, one session.

The problems that I'm having is that httpd instantiate multiple  
servers by the ServerLimit in hte worker.c module.  Every time apache  
switches process for handling one of the requests for the requests  
mod_python believe that the session is not longer valid and creates a  
new one.

I had to change my httpd.conf to look like this:

###### httpd conf

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server  
process
# MaxRequestsPerChild: maximum number of requests a server process  
serves
<IfModule worker.c>
ServerLimit          1
StartServers         1
MaxClients          25
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>

#######

In order to force apache to use the same process so the session can  
be share my multiple threads under the same process.

But as you can see this limits my number of Process to 1!

Is there any other more efficient way.

Note that the one of the objects that I need to save in the session  
CANNOT be pickled.

Thanks for any pointers,
/amn


More information about the Mod_python mailing list