On 4 August 2010 22:18, Aljoša Mohorović <[email protected]> wrote:
> On Tue, Aug 3, 2010 at 4:16 PM, John-Scott Atlakson
> <[email protected]> wrote:
>> As for optimizing, I'm assuming you are running modwsgi in daemon mode. What 
>> are your modwsgi settings? How much RAM do you have available for Apache? 
>> Will Apache be serving static requests? Other non-modwsgi applications (PHP, 
>> etc.)?
>
> apache is also serving static requests, there are only wsgi apps on server.
> server is a small ec2 instance with 1.7GB so apache can use up to 1GB
> (http://aws.amazon.com/ec2/#instance).

What is the expected amount of traffic (requests per second) for the
Python web application itself, ie., not including static file
requests?

What is your average request response time for Python web application?
Do you have long running requests, ie., uploads/downloads?

Are the operations of the Python web application I/O bounds, ie.,
database accesses etc, or compute bound, ie., lot of algorithmic
calculations being done?

What is the Python web application, ie., is it using a far Python web
framework and use a lot of memory and have to load a lot of code on
start?

> apache configuration, domain replaced with example.com:
> <VirtualHost *:80>
>        ServerName example.com
>
>        ErrorLog /var/log/apache2/example.com-error_log
>        CustomLog /var/log/apache2/example.com-access_log common
>        CustomLog /var/log/apache2/example.com-wtop_log wtop
>
>        Alias /robots.txt /var/www/wsgi/robots.txt
>
>        WSGIDaemonProcess example.com display-name=%{GROUP}
> user=www-data group=www-data

You don't need to set user/group to www-data if they are the defaults
for Apache any way as that will be inherited from User/Group
directives for Apache.

> threads=50

This is possibly too high. Even though default is 15 threads, for the
majority of people even 15 threads is more than enough.

Rather than increasing threads, there is a preference to moving to
more processes in the daemon process group.

> maximum-requests=100

This option should never be set in a production environment, you
always want to ensure process stays persistent and is not restarted.

Why are you setting this? If your Python web application keeps growing
in memory use over time, you need to work out why.

Having this option so low and thus having regular restarts of process,
plus fact only using single process, will cause client requests to
appear to hang on each restart if startup cost of Python web
application is large.

>        WSGIProcessGroup example.com
>        WSGIScriptAlias / /var/www/wsgi/example.com/project.wsgi
>
>        DocumentRoot /var/www/wsgi/example.com/
>        <Directory /var/www/wsgi/example.com/>
>                Order deny,allow
>                Allow from all
>        </Directory>
>
>        Alias /media/ /var/www/wsgi/example.com/media/
>        <Directory /var/www/wsgi/example.com/media/>
>                Order deny,allow
>                Allow from all
>        </Directory>
> </VirtualHost>

Sorry for delayed reply. Mail reader had marked message as read and
didn't see you had replied since.

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