On 07/02/2015, at 4:57 AM, Paul Royik <[email protected]> wrote:
> Thank you very much.
> However, I have a couple of questions.
> 1. New apache didn't work with memcache. I need to install memcache. Why is
> that? Previous version of apache worked without installation.
How did you install the memcache library previously and do you know where was
it installed in your account? That is way back originally before even trying
this new mod_wsgi version.
If you reinstalled it now to get it working, what command did you use to do so?
If you haven't reinstalled memcache to get it working, what was the actual
error message you were seeing in the Apache error logs or elsewhere where you
capture exception details?
I didn't add back in every Python module search path directory as based on the
information you gave they weren't required.
The only one that may well have been necessary to add back in as well was:
$HOME/lib/python2.7
but then that is where mod_wsgi-express itself was being installed and since
that was found when run, I took it to mean that WebFaction had fiddled their
Python installation to look there and so it wasn't necessary.
Can you provide the output from:
ls -las $HOME/lib/python2.7
> 2. I googled and found that webfaction memory usage is done with command ps
> -u simamura -o pid,rss,command | awk '{print $0}{sum+=$2} END {print "Total",
> sum/1024, "MB"}'. On previous version of apache average value was 550MB and
> now it is 220MB.
> Is there anyway we could find out what exactly processes eat memory. I still
> don't know whether it is my application, and if it is where to search. Maybe
> it is single page, that does such things. You gave me command 'ps auxwww'.
> Here is it output, but I can't understand what it means:
>
> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> simamura 9731 13.8 1.1 1148500 193184 ? Sl 16:14 14:10
> (wsgi:localhost:20241:1092) -f
> /home/simamura/webapps/django_math/express/httpd.conf -DWSGI_ACCESS_LOG
> -DWSGI_MPM_ENABLE_EVENT_MODULE -DWSGI_MPM_EXISTS_EVENT_MODULE
> -DWSGI_MPM_EXISTS_WORKER_MODULE -DWSGI_MPM_EXISTS_PREFORK_MODULE -k start
This is your actual WSGI application process. That is, the one in the form
(wsgi:localhost:XXX:1092) where XXX is the port number for Apache for this
application.
It is using resident memory size of 193184 kilobytes, that is, just under 200
megabytes.
> simamura 22495 0.0 0.0 66380 2976 ? Ss 15:59 0:00 httpd
> (mod_wsgi-express) -f
> /home/simamura/webapps/django_math/express/httpd.conf -DWSGI_ACCESS_LOG
> -DWSGI_MPM_ENABLE_EVENT_MODULE -DWSGI_MPM_EXISTS_EVENT_MODULE
> -DWSGI_MPM_EXISTS_WORKER_MODULE -DWSGI_MPM_EXISTS_PREFORK_MODULE -k start
Of these latter three which show all the same, this is the Apache parent
process. At least that is my assumption based on it being the lowest process ID
and having smallest resident memory size.
It is taking less than 3 megabytes.
> simamura 31149 0.0 0.0 661460 3524 ? Sl 16:05 0:01 httpd
> (mod_wsgi-express) -f
> /home/simamura/webapps/django_math/express/httpd.conf -DWSGI_ACCESS_LOG
> -DWSGI_MPM_ENABLE_EVENT_MODULE -DWSGI_MPM_EXISTS_EVENT_MODULE
> -DWSGI_MPM_EXISTS_WORKER_MODULE -DWSGI_MPM_EXISTS_PREFORK_MODULE -k start
> simamura 31992 0.0 0.0 726996 3588 ? Sl 16:05 0:01 httpd
> (mod_wsgi-express) -f
> /home/simamura/webapps/django_math/express/httpd.conf -DWSGI_ACCESS_LOG
> -DWSGI_MPM_ENABLE_EVENT_MODULE -DWSGI_MPM_EXISTS_EVENT_MODULE
> -DWSGI_MPM_EXISTS_WORKER_MODULE -DWSGI_MPM_EXISTS_PREFORK_MODULE -k start
These are the Apache child worker processes which actually accept requests
initially. In your setup all they are doing is proxying requests through to the
WSGI application process. If you weren't setting up WebFaction to serve your
static assets using the front end nginx process, they also could have been
setup to serve up the static assets.
Important thing to realise here. Your prior configuration was using processes=2
for WSGIDaemonProcess. That was actually wasteful because the Apache child
worker configuration wasn't allocating enough capacity to even proxy that many
requests.
The current configuration therefore is only creating one WSGI application
process and therefore your WSGI application memory in total would have been
halved straight away.
So the question is whether your figure of 550MB is across all processes, or
that is what you were getting for a single process.
I did tell you back in the start to change WSGIDaemonProcess back to not create
2 processes. I can't recollect whether you did that or not.
if you didn't and that 550MB memory size you were talking about was across all
processes, then the end result is about right, we simply halved overall memory
usage by dropping down to one WSGI application process.
If that is the case, although this whole exercise has been extremely useful to
me for various reasons, it may well have been a waste of your time because you
could simply have removed 'processes=2' option from WSGIDaemonProcess and got
the same result.
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.