After further testing I've noticed this:
Just after restarting Apache:
mod_python: 2.52s
mod_wsgi: 2.08s
subsequent requests give more or less the same results.
After 9 requests or so:
mod_python: 5.28s
mod_wsgi: 4.5s
... and so on.
Finally, mod_wsgi seems to be faster but could you explain why every 9
requests cPcikle takes 2 more seconds to load an object while it is
more or constant in between ?
For me 2s would be acceptable (and it seems that I could cut that by
two by moving to a more recent box under Fedora 9 and Python 2.5.1).
I'm timing around cPickle this way:
import cPickle, time
def elapsed(): return str(round(time.clock(),4))
start = time.clock()
index = cPickle.load(open('index.db'))
return 'Index loaded: %' % elapsed()
The index is a dictionary with a string (an English word) as key and a
set() of strings (14 characters max) as value.
There are around 18000 entries in it and the pickle object is 6MB.
By the way, is their a mean to load this dictionary once in memory
with mod_wsgi and use it in subsequent requests, or do I need to run a
separate Python process and communicate with it using sockets ?
Olivier.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---