On May 14, 7:14 pm, Valery Khamenya <khame...@gmail.com> wrote:
> Hi,
>
> I have 2 issues that presumably could be related:
>
> 1. when I totally stop apache, I see that some apache processes remain
> running. When I repeat the stop operation, apache says that apache is not
> running, whereas the processes do exist. So, I have to kill them manually.

You need to ascertain whether they were Apache parent process, Apache
server child worker processes, or mod_wsgi daemon mode processes.

> 2. For a single HTTP request I see that multiple calls of the corresponding
> rendering function of a view.py are invoked. The overhead like 30 calls per
> single HTTP request is not acceptable neither from performance nor logic
> requirements.
>
> Details:
>
> a. both issues appeared after I've switsched to WSGI dipatching model.

Did you disable mod_python out of Apache when you switched. Loading
both at same time is not recommended as can cause some problems.

> b. I use wsgi-based dispatching for apache prefork (unfortunatelly I am
> restricted for prefork currently) as descreibed here right in the beginning
> of the document:http://pinaxproject.com/docs/dev/deployment.html

Be aware of the dangers of prefork. Read:

  http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html

Why are you restricted to using prefork? Also, that documentation says
to use daemon mode which makes the MPM irrelevant, because if you
configure it properly the application runs in separate process like in
fastcgi.

What the documentation doesn't explain is to use the option:

  display-name=%{GLOBAL}

to WSGIDaemonProcess. This will allow you to use 'ps' to see whether
the Apache process is actually the Django process, ie., mod_wsgi
daemon process, or not. See the official mod_wsgi documentation for
more detail:

http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess

> c. Also, to restart my app I sometime use "touch my-dispatcher.wsgi" as it
> was mentioned somewhere in django docs.

Perhaps also read mod_wsgi documentation on source code reloading to
find out what that is doing:

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

> d. the file my-dispatcher.wsgi is basically like 
> this:http://github.com/pinax/pinax/blob/1f6d2d1216c5e8539639ef561349e4277f...
>
> Your input is very welcome, thanks in advance.
>
> P.S. I doubt that the troubles are purely Pinax-related, but if so, I am
> sorry.

You need to identify what role the process was doing. The display-name
option can help with that. Also set LogLevel to at least 'info' as
explained in:

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

Then you need to work out what the process is perhaps hanging on.

Graham
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to