2009/11/16 Daan Davidsz <[email protected]>:
>
> At first I would like to say I want to run in daemon mode.
>
> My current global configuration is this:
> WSGIProcessGroup abc
> WSGIDaemonProcess abc threads=8 display-name=mod_wsgi:abc
>
> The problem with this is that all sorts of things start interfering
> with eachother. For example the os.chdir() function causes havoc
> because of all the different threads changing it at different times.
Web applications assuming they can change directories for individual
requests or which only work when run from a specific directory are
arguably poorly designed. Such techniques will never work properly
where multithreading is used or where multiple instances of the
application need to run in same process.
It is much better that file system accesses always be by absolute pathname.
> Now I think this configuration should solve these issues:
> WSGIProcessGroup abc
> WSGIDaemonProcess abc threads=1 processes=8 display-name=mod_wsgi:abc
>
> But I don't think that is very scalable or lean.
Not scalable and lean in what way?
You will use just as much memory if you were to create as many
distinct process groups as you have applications and with each having
8 processes each running a single thread.
The only thing wrong I can see in above is that it will still not
solve problem where a web application expects to always be run out of
a specific directory and only sets that directory location once when
web application first loaded. This is because last such similar
application to load will override location for others due to web
application instances still being in same process.
> I've tried some config with %{ENV:SCRIPT_FILENAME} but it doesn't seem
> to work. Is there a way that I can give every script its own
> processgroup and threads from a global configuration file?
At the moment only by duplicating WSGIDaemonProcess/WSGIProcessGroup
configuration for each application.
Because I don't know whether you are currently using WSGIScriptAlias
on specific WSGI script file, or mapping it against a directory of
WSGI script files, or using AddHandler, can't guide you as to exactly
what you need to do.
Short answer is though that you aren't restricted to one
WSGIDaemonProcess/WSGIProcessGroup configuration.
Can you provide the rest of your mod_wsgi related configuration?
Can you also explain why your web applications are changing the
working directory in the first place and not using absolute path names
for file system access as would be regarded as being best practice?
Graham
--
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=.