Loading...

modwsgi@googlegroups.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: [modwsgi] Re: Can you mix embedded and daemon mode running under a single apache process? Graham Dumpleton Thu Feb 02 04:06:56 2012

Some frameworks don't like running multiple application instances in
the same interpreter. Django is like this and so you can't force
multiple instances to all run in the main interpreter.

BTW, in:

http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation

there are various examples of small WSGI scripts you can use to
validate whether running in embedded or daemon modes and whether in
main interpreter or sub interpreter.

Graham

On 19 January 2012 19:43, Jonathan Thomas <[EMAIL PROTECTED]> wrote:
> Thanks, after a bit of cleanup of things I tried between question and
> answer I have everything up and running now.
>
> The application running in daemon mode is also using subprocess on
> python 2.7.2 so I ran into the autoTLSkey mapping error (https://
> groups.google.com/forum/#!msg/modwsgi/DW-SlIb07rE/FTE7A8WZ8msJ)
>
> If I add the WSGIApplicationGroup %{GLOBAL} my problems go away and it
> *seems* like my configuration is holding up and requests are being
> served properly.  I have to admit though that I'm not 100% confident
> that the system is behaving as intended due to my lack of familiarity
> with both apache and mod_wsgi configuration options.
>
> I updated the conf like below, are there any side-effects I need to
> worry about?  Other than running all the /app processes in the main
> interpreter instead of in sub-interpreters?
>
>> WSGIDaemonProcess app user=admin processes=3 threads=1
>>
>> WSGIScriptAlias /app/ /var/www/wsgi-scripts/pastedeploy-app.wsgi
>> process-group=app
>  WSGIApplicationGroup %{GLOBAL}
>>
>> WSGIScriptAlias / /var/www/wsgi-scripts/pastedeploy.wsgi
>
> -Jonathan
>
> On Jan 18, 4:37 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> wrote:
>> You can mix them.
>>
>> Interpretation of WSGIProcessGroup is not done in order with other
>> directives, whichever is last wins.
>>
>> Since you are using mod_wsgi 3.x one way you can be more precise by doing:
>>
>> WSGIDaemonProcess app user=admin processes=3 threads=1
>>
>> WSGIScriptAlias /app/ /var/www/wsgi-scripts/pastedeploy-app.wsgi
>> process-group=app
>>
>> WSGIScriptAlias / /var/www/wsgi-scripts/pastedeploy.wsgi
>>
>> The more long handed way is to use:
>>
>> WSGIDaemonProcess app user=admin processes=3 threads=1
>>
>> WSGIScriptAlias /app/ /var/www/wsgi-scripts/pastedeploy-app.wsgi
>>
>> WSGIScriptAlias / /var/www/wsgi-scripts/pastedeploy.wsgi
>>
>> <Directory /var/www/wsgi-scripts/>
>> <Files paste deploy-app.wsgi>
>> WSGIProcessGroup app
>> </Files>
>> </Directory>
>>
>> In other words, you scope the WSGIProcessGroup to WSGI script fel in file
>> system.
>>
>> Rather than Directory/Files, you could also say:
>>
>> <Location /app>
>> WSGIProcessGroup app
>> </Location>
>>
>> so, as long as isn't qualified in one of those ways, will still run in
>> embedded mode.
>>
>> Graham
>>
>> On Wednesday, 18 January 2012, Jonathan Thomas <
>>
>>
>>
>>
>>
>>
>>
>> [EMAIL PROTECTED]> wrote:
>> > I am mostly looking for clarification here since nothing I read in the
>> > docs specifically says you can't mix embedded and daemon modes,
>> > although there is an implied either or which seems to be backed up by
>> > empirical testing.
>>
>> > Which leads me to wonder whether it's possible and I've misconfigured
>> > my server, or whether it's not possible.
>>
>> > Here is what I'm trying to do in the main server section of the apache
>> > configuration.  In this scenario lets assume virtual hosts are
>> > discouraged.  This configuration starts fine, and all urls are
>> > reachable, but the only processes that are used are the ones defined
>> > under the DaemonProcess directive (as determined by ps and looking at
>> > the CPU time)
>>
>> > I'm using
>> > httpd-2.2.20 in prefork mode
>> > mod_wsgi-3.3
>>
>> > config snippet
>> > ...
>> > User nobody
>> > ...
>> > #Serve the first application under a separate user
>> > WSGIDaemonProcess app user=admin processes=3 threads=1
>> > WSGIScriptAlias /app/ /var/www/wsgi-scripts/pastedeploy-app.wsgi
>> > WSGIProcessGroup app
>>
>> > #Then serve everything else using embedded mode.
>> > WSGIScriptAlias / /var/www/wsgi-scripts/pastedeploy.wsgi
>>
>> > <Directory /var/www/wsgi-scripts>
>> > Order allow,deny
>> > Allow from all
>> > </Directory>
>>
>> > A definitive answer would be most welcome, let me know if you need
>> > more information.
>> > -Jonathan
>>
>> > --
>> > 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.
>>
>>
>>
>>
>>
>>
>>
>>
>
> --
> 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.
>

-- 
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.