Just to make sure, were you performing a complete Apache 'stop'
between these tests?
If you had lazy initialisation to be Off and then changed it to On and
did only an apachectl restart, then latter test would be tainted due
to memory leaks by Python into Apache parent process.
Am also a little bit confused as to which processes are which. Your
prior results had:
New 'worker'
2144 1072 27533 /home/username/webapps/bimmdjango/apache2/bin/httpd
3612 227336 27539 /home/username/webapps/bimmdjango/apache2/bin/httpd
(mod_wsgi)
1940 226440 27563 /home/username/webapps/bimmdjango/apache2/bin/httpd
I assume this was one Apache parent process, one worker MPM Apache
server child process and one mod_wsgi daemon process. Also assumed
that 1940 was Apache parent and 2144 was server child process.
In latest, not so clear on what processes are which.
If I get time maybe I need to get on WebFaction and have a look
myself. They let me have an account to play with for a while but time
expired. I think I can still log in, just no one can make requests
against it from outside. Still sufficient to look at base memory
usage.
Oh, one final bit of advice. If you are only running the one Python
web application, set:
WSGIApplicationGroup %{GLOBAL}
This will force it to run in main Python interpreter rather than new
sub interpreter with the process. Saves a little bit on overhead of
additional sub interpreter.
Graham
2009/12/2 Peter Mott <[email protected]>:
> Graham Dumpleton wrote:
>
> 2009/12/2 peter2108 <[email protected]>:
>
>
> I compiled Apache with 'worker' MPM and installed v3.1 of mod-wsgi
> using the webfaction forum post you pointed out to me. I used the
> Apache conf as in the post but added WSGIRestrictEmbedded On. This
> seems to work fine. The RSS values (obtained using 'ps' )
> are:
>
> Original 'prefork'
> RSS SZ PID
> 1948 936 6774 /home/username/webapps/bimmdjango/apache2/bin/httpd
> 3336 1932 6781 /home/username/webapps/bimmdjango/apache2/bin/httpd
> 3336 1932 6782 /home/username/webapps/bimmdjango/apache2/bin/httpd
>
> New 'worker'
> 2144 1072 27533 /home/username/webapps/bimmdjango/apache2/bin/
> httpd
> 3612 227336 27539 /home/username/webapps/bimmdjango/apache2/bin/
> httpd (mod_wsgi)
> 1940 226440 27563 /home/username/webapps/bimmdjango/apache2/bin/
> httpd
>
> which is an 11% saving. I don't know how the values on the webfaction
> forum were obtained so I
> can't say if these are as expected.
>
>
> If you happy to fiddle a bit more. Using mod_wsgi 3.1, you might
> compare that to using:
>
> WSGILazyInitialization Off
> WSGIRestrictedEmbedded Off
>
> This effectively restores 3.1 behaviour to what it was with 2.X.
>
> That way you can see what 3.1 would have looked like under worker MPM
> with old way of doing things.
>
> This will give a better indication of whether the lazy initialisation
> and restrictions on embedded mode is working for that MPM.
>
> It is a bit fuzzy at the moment as to what sort of configurations you
> might see less memory used with what is now the default in 3.1. So,
> some feedback would be nice.
>
> 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.
>
>
> I tried all four combinations. Pretty clearly WSGIRestrictedEmbedded On
> is required with 3.1. The Off/Off configuration uses alot more memory than
> I had with my (standard Webfaction) prefork set up. I actually added v3.1
> to the pre-fork version of Apache and got RSS=9800 (approx, from memory).
> whereas I was getting 8000 odd before. So putting 3.1 with a pre-fork may
> not be
> a good idea.
>
> Here are the details:
>
> WSGILazyInitialization On, WSGIRestrictEmbedded Off,
>
> 2072 1072 2560 /home/username/webapps/bimmdjango/apache2/bin/httpd -k
> start
> 3544 227336 2567 /home/username/webapps/bimmdjango/apache2/bin/httpd -k
> start
> 3868 227336 2584 /home/username/webapps/bimmdjango/apache2/bin/httpd -k
> start
>
> WSGILazyInitialization Off WSGIRestrictedEmbedded Off:
>
> 3832 1968 6268 /home/username/webapps/bimmdjango/apache2/bin/httpd -k
> start
> 3120 227336 6275 /home/username/webapps/bimmdjango/apache2/bin/httpd -k
> start
> 3404 227336 6298 /home/username/webapps/bimmdjango/apache2/bin/httpd -k
> start
>
> WSGILazyInitialization On, WSGIRestrictedEmbedded On:
>
> 2140 1072 12680 /home/username/webapps/bimmdjango/apache2/bin/httpd -k
> start
> 3608 227336 12687 /home/username/webapps/bimmdjango/apache2/bin/httpd -k
> start
> 1932 226440 12688 /home/username/webapps/bimmdjango/apache2/bin/httpd -k
> start
>
> WSGILazyInitialization Off, WSGIRestrictedEmbedded On:
> 3768 1968 12356 /home/username/webapps/bimmdjango/apache2/bin/httpd -k
> start
> 3040 227336 12363 /home/username/webapps/bimmdjango/apache2/bin/httpd -k
> start
> 2724 227336 12364 /home/username/webapps/bimmdjango/apache2/bin/httpd -k
> start
>
>
> -- Peter
>
>
> --
>
> 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.
>
--
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.