[mod_python] some remarks, a few questions and

francois lepoutre francoislepoutre at compuserve.com
Fri Nov 29 10:38:12 EST 2002


Hi all modpython users,

First modpython is plain great.We like some much
and even more so as an apache project :)

Thanks Grisha and all.

I just moved a couple of thousand lines of python from 
apache 1.3.27/modpython 2.7.4/python 2.1.1 (w2k) 
into apache 2.0.43/modpython 3.0.1/python 2.2.2 (w2k)

Some remarks:
1) INSTALLATION ON WIN32 WAS A SNAP, GREAT.
Automation has significantly improved for all components
Thanks to the apache and python communities 

2) The new install run exactly in the same way.
Perf and behaviour are nearly identical... that's both good 
(because every thing works ok) and mixed feeling 
(why change version). But we are not specifically 
looking for performance improvement anyway.

I hope that *nix apache users are feeling some perf 
improvements because of the new fork+thread model. 
Win32 runs the same. At least for us.

Now a few questions at this stage:
When running the old stuff (modpython 2.7) we maintained
two distinct series of modpython code:
- one plain simple set of routines for forking *nix (for a RH customers),
- win32-specific code with thread-mngt stuff (and connection pooling)
for various w2k set-ups.

We like the idea of a unified programming model a lot :)

With the new Apache2/modpython3 model can we expect :
- to run thread-enabled python on both environments (*nix and win32)?
- to run the same code (with thread-caring stuff) in both environment? 
- the thread-management routines to be of any use on *nix setups 
if they use a mixed "fork+thread" apache model?

Is this model fork+thread of any use or interest for modpython users?
I'm no python expert but have some doubt about the latest in view
of the way python runs its own threading stuff.

In the end a bug report (did i miss something on the apache 2 config.?).
The code below will work on 2.7.* and break on 3.0.1 (W2K).

from mod_python import apache

def handler(req):
    req.write("Your local address:%s %i" % \
    (req.connection.local_addr[0],req.connection.local_addr[1]))
     return apache.OK

Regards

Francois




More information about the Mod_python mailing list