[mod_python] High traffic recommendations

Graham Dumpleton grahamd at dscpl.com.au
Thu Feb 16 18:38:43 EST 2006


Marc D. Murray wrote ..
> The next question I have now is, should think about replacing the
> publisher module with something less feature full? Right now, the only
> thing I'm using the publisher handler for is to locate and execute the
> correct function from the appropriate module. You know, the traversal
> bit.
> 
> If I decide to replace the publisher handler, my handler would be
> generating the cache keys and checking the cache. If the cache-item
> doesn't exist, then import the module based on values in req.parsed_uri
> and execute the appropriate function, then req.write the output.
> 
> Somehow I believe this would yield better behaviour.
> 
> Am I on the right path here? Or is this a waste of time as the Publisher
> is already efficient? 

I would suggest staying with publisher for now as it is known to
correctly do the mapping of URL to Python object. Getting this all
right isn't simple. Get it wrong and you might end up with a security
hole. Also, in mod_python 3.2.7 publisher uses its own module
loader which solves a lot of problems. If you write your own dispatcher
and use apache.import_module(), you expose yourself to all the old
module importer problems again until apache.import_module() is
fixed.

Graham


More information about the Mod_python mailing list