On Sep 12, 10:35 am, "Chris Spencer" <[EMAIL PROTECTED]> wrote:
> On Thu, Sep 11, 2008 at 6:16 AM, Graham Dumpleton
>
>
>
> <[EMAIL PROTECTED]> wrote:
> > Be aware that Apache/mod_wsgi in embedded mode on UNIX is going to be
> > multiprocess. Thus where you think it is being loaded on every
> > request, it is more likely just the result of the various processes
> > loading the application the first time it is used. After they are all
> > loaded, you shouldn't see loading occurring.
>
> > Anyway this is it in simple terms, as it is actually more complicated
> > than that as Apache can kill off processes and replace them in certain
> > situations.
>
> > For some details of how processes are used in Apache/mod_wsgi see:
>
> > http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading
>
> > To know what is definitively what is going on, following instructions
> > in:
>
> > http://code.google.com/p/modwsgi/wiki/DebuggingTechniques
>
> > and set:
>
> > LogLevel info
>
> > in Apache configuration, in place of default 'warn'. This should
> > result in mod_wsgi outputing a lot of information into main and per
> > virtual host, as appropriate, error logs about when processes are
> > being started/restarted and when WSGI application scripts being
> > loaded.
>
> > So do that and report on what you see, including examples of Apache
> > error logs which you believe shows the behaviour you are claiming.
>
> I set LogLevel, and after each request, the only thing I'm seeing in
> the log is something like:
> [Thu Sep 11 20:17:37 2008] [info] mod_wsgi (pid=18858): Create
> interpreter 'localhost.localdomain|/myapp'.
> [Thu Sep 11 20:17:37 2008] [info] [client 127.0.0.1] mod_wsgi
> (pid=18858, process='', application='localhost.localdomain|/myapp'):
> Loading WSGI script '/usr/local/django/myapp/apache/django.wsgi'.,
> referer:http://localhost/myapp
>
> Is there any way to force a specific WSGI app to run on a single
> process, without changing the number of processes used otherwise on
> the server? I've toyed around with WSGIDaemonProcess, but all this
> seems to do is break the debugger without fixing the problem. Would I
> use something like:
>
> WSGIDaemonProcess myapp processes=1 threads=1
Which debugger? Any specific reason you are using a single thread,
such as using older Django version or your application is not
multithread?
Anyway, the in web browser debuggers I know of will only work if one
process, but 'processes=1' still marks it as multiprocess in WSGI
environment. Just drop 'processes=1' and let if use default of 1
process. If you don't do that the debugger may complain it is not
running in valid environment. Thus:
WSGIDaemonProcess myapp thread=1
WSGIProcessGroup myapp
For more information on web browser debuggers and debugging in general
see:
http://code.google.com/p/modwsgi/wiki/DebuggingTechniques
Also see comments about WSGI multiprocess/multithread flags in:
http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading
For configuration of WSGIDaemonProcess see examples in:
http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines
http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives
Sorry, but have to run somewhere. Will check later than I actually
answered your question. I may not have. ;-)
Graham
> How does that directive differentiate between multiple WSGI apps
> running on the same server? The docs mention that it specifies a
> "process group", but how do you make a single WSGI Django app run in
> that process group?
>
> > Also, you should still post the configuration you use so we can
> > confirm it is correct. I have many times had people say they followed
> > the documentation, but in fact they had tweaked it slightly and
> > inadvertently caused problems for themselves.
>
> What I posted is my exact configuration. It's a simple minimal case
> app for testing this problem.
>
> Regards,
> Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---