[mod_python] Mod_python and Sub-Interpreter segregation

Michael Neel neel at mediapulse.com
Fri Sep 13 23:07:50 EST 2002


Thank will work great, until you hit the 65th concurrent connection, at
wich point apache will give you another child. Another thing to keep in
mind is that if one thing goes wrong in any thread, there goes your
whole server.  (just a side note, to test a web server I use the ab tool
that comes with apache; it will let you set the concurrent number of
theard to try and get at once).

I saw a python tool mentioned in another thread;
http://www.object-craft.com.au/projects/albatross/ which I'm looking at
myself right now, so I have no experience with, but after a first read
though looks very promising when used with mod_python and has several
options for saved states and should have some good choices for globals
in there.

Mike 

-----Original Message-----
From: mod_python-admin at modpython.org
[mailto:mod_python-admin at modpython.org] On Behalf Of Bryan Mongeau
Sent: Friday, September 13, 2002 4:00 PM
To: mod_python at modpython.org
Subject: Re: [mod_python] Mod_python and Sub-Interpreter segregation


Thanks for all the great replies everyone! I appreciate it.

On September 13, 2002 09:58 pm, Brian Hawthorne wrote:
> hmmm,
> currently you can share global vars if you set apache to have exactly 
> one child process (but to great performance detriment).  i was 
> imagining you could do the same in the perthread server by setting the

> numprocs=1 and letting the numthreads grow/shrink (recouping the 
> performace hit with extra threads).

Thanks alot for this idea! I compiled apache with the worker MPM, set 
StartServers to 1 and ThreadsPerChild to 64. The result? My shared
memory hit 
counter works perfectly and clocks about 50 hits/sec on my 800 Mhz,
which, 
according to my rough hand benchmarks, is actually a little faster than
using 
prefork with StartServers at 5!

Seems as if my problem is solved.. at least for now, thanks!

> actually, it should be pretty easy to wrap a bit of code around python

> shelve to turn some dbm file into a modpyglobal repository of python 
> objs keyed by varname.  that's what i would do if i didn't feel like 
> dealing with a real db.  also, if you don't use an external 
> repository, you have to worry about server restarts and child procs 
> getting killed etc.

This is almost exactly what I have in mind :) More later,
-- 
Bryan Mongeau
eEvolved Inc. - IT Consulting & Custom Software http://eevolved.com/
--
"Let us understand what our own selfish genes are up to, because we may
then 
at least have a chance to upset their designs, something that no other 
species has ever aspired to do." -- Richard Dawkins

_______________________________________________
Mod_python mailing list
Mod_python at modpython.org
http://www.modpython.org/mailman/listinfo/mod_python




More information about the Mod_python mailing list