On Apr 18, 11:39 pm, "Sean Davis" <[EMAIL PROTECTED]> wrote:
> Just a simple question:
>
> It looks to me like each pylons application gets one-and-only-one
> interpreter under mod_wsgi. This implies that globals have the same
> behavior as with the standalone server (and is distinctly different from
> what would happen under mod_python, I think). I ask because I would like to
> use a global threadpool as a simple job queue system, which I want to have
> available to all requests as a global. Is my understanding close to
> correct?
Not quite correct.
In mod_wsgi it defaults to using a different sub interpreter for each
defined WSGI application. You can override this though with the
WSGIApplicationGroup configuration directive. See:
http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives
Thus, provided that your different WSGI applications can safely
cooexist, then you can run them in the same sub interpreter to cut
down on process size by not having duplicates of modules loaded in
different sub interpreters.
Do note though that when I say WSGI application, I am talking about
from the entry point down. If you are using the composition features
of Pylons/Paste to bring together multiple WSGI components under one
URL mount point, then they all run in the same sub interpreter anyway.
In respect of your job queue system, do realise that Apache on UNIX
systems typically uses multiple processes to handle requests. As a
result, each process will have one of these job queues which may not
be what you want. If you want only one job queue across all requests,
you will need to place it in some separate daemon process and
communicate with that process using something like XML-RPC.
Work is being down on mod_wsgi to add features which will allow all
requests for one WSGI application to be handled within one persistent
daemon process spawned by mod_wsgi. This when available will also
allow you to have only one job queue as there will be only one process
for that WSGI application. That separate process will also be able to
run as a specific user as well and not whatever use that Apache runs
as.
BTW, questions on mod_wsgi are best asked on the Google modwsgi group
as unlikely that many in other forums would have that much experience
with it yet and be able to answer questions with full knowledge of how
it truly works.
Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---