On Jan 28, 10:43 pm, Graham Dumpleton <[email protected]>
wrote:
> 2010/1/29 janedenone <[email protected]>:
>
> > I would like to make sure I understand the interaction of Apache and
> > mod_wsgi configuration parameters with respect to memory usage and
> > performance correctly. After reading a couple of posts in this group
> > and at other places, I am still somewhat confused.
>
> > Apache (prefork MPM) and mod_wsgi are installed on a small VPS
> > (serving approx. 1000 pages/day), and mod_wsgi is used in daemon mode
> > to run Django applications. I tried tinkering with both the MPM
> > parameters
>
> > StartServers 1
> > MinSpareServers 1
> > MaxSpareServers 5
> > MaxClients 50
> > MaxRequestsPerChild 1000
>
> > and the WSGIDaemonProcess options
>
> > WSGIDaemonProcess djangoproject user=nobody group=nobody threads=10
> > maximum-requests=1000 deadlock-timeout=30 inactivity-timeout=100 stack-
> > size=524288
>
> Do you have a corresponding WSGIProcessGroup directive for the
> WSGIDaemonProcess, or tagging WSGIScriptAlias with process-group
> option?

Yes, I do. This is my complete configuration (MPM- and mod_wsgi-
related):

<IfModule prefork.c>
StartServers 1
MinSpareServers 1
MaxSpareServers 5
MaxClients 50
MaxRequestsPerChild 1000
</IfModule>

WSGISocketPrefix /var/run/wsgi
WSGIRestrictEmbedded On

<VirtualHost 87.106.49.95:80>
        ServerName janeden.net

        AliasMatch ^/(css|images|files|admin_media)(.*) /var/www/
djangoproject/static/$1/$2

        <Directory /var/www/djangoproject/static>
                Order deny,allow
                Allow from all
        </Directory>

        WSGIScriptAlias / /var/www/djangoproject/apache/django.wsgi

        WSGIDaemonProcess djangoproject user=apache group=apache threads=10
stack-size=524288 maximum-requests=3000 deadlock-timeout=30 inactivity-
timeout=100
        WSGIProcessGroup djangoproject

        <Directory /var/www/djangoproject>
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

There are actually three VirtualHosts like the one above, but they are
defined almost identically (the only difference being the ServerName,
WSGIDaemonProcess name, WSGIProcessGroup name and directories).

> Also, are you running PHP in the same server? If not, do not use
> prefork MPM, use worker MPM instead. If you can, get rid of mod_php if
> you are using it, using mod_fcgid for PHP instead.

I don't use PHP, so I can switch to the worker MPM. Is there anything
in the above configuration (or in other areas of httpd.conf) which
should be reviewed prior to switching the MPM? The default worker
configuration currently looks like this:

StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0

> I will explain everything properly later when have a chance.
>
> In the mean time, please post all parts of the Apache configuration
> showing how you are setting up mod_wsgi for your application so can
> verify it is set up correctly.

Thanks a lot for your help! This is by far the most responsive and
professional 'product support' I have seen for an open-source package
so far.

- Jan

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