On 22 February 2010 10:45, Szymon Kosok <[email protected]> wrote:
> 2010/2/22 Graham Dumpleton <[email protected]>:
>> What daemon process configuration are you currently using?
>
> processes=4 threads=25

If running 4 processes, seems a but odd that only 1 process is 200 MB.
I presume this is the worst of the processes.

Suggest you ensure you are using:

  display-name=%{GROUP}

option to WSGIDaemonProcess so that process labelled in 'ps' output as
being for WSGI application. That way easier to know for sure that it
is the mod_wsgi daemon process that is getting fat.

What are the sizes of the other Django processes?

Presumably the 200MB process has come about due to a large transient
memory requirement for a specific request. Having specific URLs that
generate a large transient memory usage is obviously not good as the
process then keeps that memory. You have 2GB memory so overall not an
issue, but still always better to try and keep memory usage to a
minimum as would at least allow you to have more process in daemon
process group and drop down number of threads in processes to try and
counter any adverse effects from Python GIL when used on multi
processor machine.

Do you know whether/what URLs have a large transient memory
requirement? Have you done any profiling on requests so you know which
are the URLs which take memory and or cause a greater CPU load.

>> You have 40-50 req/s, but do you know what your typical/worst case
>> request response times are?
>
> On low traffic, ~200 msec. On higher traffic - sometimes 2 sec. (but
> some areas of project need to be optimized). So typical is 400-500
> msec.

Overall you appear to be going about things the right way, ie., nginx
front end proxy for static files etc, separate database server. At
this point you probably start needing to identify where bottlenecks
are in application and try and make use of caching to avoid
regenerating page content all the time. Know which URLs to target
would come from looking at web statistics and knowing which URLs are
visited most. On most sites the home page will be hit the most, so
focusing on that page and making it perform as good as possible would
be where to start.

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

Reply via email to