On 09/11/2014, at 6:24 AM, sags <[email protected]> wrote:

> Hi Graham,
> 
> I am been reading your blogs and posts on mod_wsgi configurations. We build 
> some programming modules using an open source django based application 
> originally developed for MOOCs. We modified the application based on our 
> requirements but we didn't change much underlying frame work of that open 
> source code.The application is running fine but server some time crashed due 
> to out of memory issue. At a time around 30 students use this application in 
> a class. We monitored, using free -m command, approximately 30 students when 
> using the application at the same time, the memory consumption approximately 
> goes down by 200-300 MB. But the problem is once students log out from the 
> sessions, the memory doesn't seem to get released. Due to which the memory 
> consumption goes on increasing again and again. For the time being we have 
> wrote a script to clear the cache if memory goes below 500 MB using echo 1 > 
> /proc/ .../drop_caches and it seems to be freeing lot of memory. Is there 
> some permanent solution to it. We are using red hat VM server for hosting our 
> application. We except more teachers using this application, which means 
> traffic is going to be high in future.
> 
> FYI: We are using mod_wsgi deamon mode with processes = 2 and Threads = 15 
> 
>   
> 
> Is it due to the django or could it be due to OS or httpd configuration 
> issues?
> 
> I would appreciate your feedback on it.

How are you monitoring memory usage and what processes are specifically taking 
up the memory?

I don't understand how:

    echo 1 > /proc/sys/vm/drop_caches

as described in:

    http://linux-mm.org/Drop_Caches

can affect the run time memory usage of specific Python web application 
processes.

BTW, in monitoring memory used by Apache, ensure that if using mod_wsgi daemon 
mode that you are using the option:

    display-name=%{GROUP}

to the WSGIDaemonProcess directive.

By doing this it will result in the process names as shown by 'ps' and 'htop' 
being the name of the mod_wsgi daemon process group name. This way you can 
distinguish between normal Apache processes and the mod_wsgi daemon process 
groups.

For example, for:

    WSGIDaemonProcess mysite display-name=%{GROUP} processes=2 threads=15

You will see in 'ps' out:

    httpd (or apache2 on some systems) running as root - Apache parent process
    httpd (or apache2 on some systems) running as Apache user - Apache child 
worker processes
    (wsgi:mysite) - mod_wsgi daemon process group processes

if you are pinning it to an Apache processes, which of these is showing 
increase memory usage.

Also, what version of Apache and mod_wsgi are you using?

Graham

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to