WebFaction
Community site: login faq
0
1

I'm having some problems whit django memory consume. I've three apps runing. First of all: - All ones have debug set False - The apache conf are all similars, like this: ServerRoot "/home/aureasys/webapps/ppr/apache2"

LoadModule dir_module        modules/mod_dir.so
LoadModule env_module        modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module       modules/mod_mime.so
LoadModule rewrite_module    modules/mod_rewrite.so
LoadModule setenvif_module   modules/mod_setenvif.so
LoadModule wsgi_module       modules/mod_wsgi.so

LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /home/aureasys/logs/user/access_ppr.log combined
ErrorLog /home/aureasys/logs/user/error_ppr.log
KeepAlive Off
Listen 16468
MaxSpareThreads 3
MinSpareThreads 1
ServerLimit 1
SetEnvIf X-Forwarded-SSL on HTTPS=1
ThreadsPerChild 5
WSGIDaemonProcess ppr processes=2 python-path=/home/aureasys/webapps/ppr:/home/aureasys/webapps/ppr/lib/python2.6 threads=1
WSGIPythonPath /home/aureasys/webapps/ppr:/home/aureasys/webapps/ppr/lib/python2.6
WSGIScriptAlias / /home/aureasys/webapps/ppr/ppr.wsgi
  • All media is served static way

I've this process runing:

aureasys@web151:~$ ps -u aureasys -O pid,rss,command
  PID   PID   RSS COMMAND                     S TTY          TIME COMMAND
  489   489  1816 /home/aureasys/webapps/ppr/ S ?        00:00:00 /home/aureasys/webapps/ppr/apache2/bin/httpd.worker -f /home/aureasys/webapps/ppr/apache2/conf/httpd.conf -k start
  490   490  3468 /home/aureasys/webapps/ppr/ S ?        00:00:00 /home/aureasys/webapps/ppr/apache2/bin/httpd.worker -f /home/aureasys/webapps/ppr/apache2/conf/httpd.conf -k start
  491   491  3452 /home/aureasys/webapps/ppr/ S ?        00:00:00 /home/aureasys/webapps/ppr/apache2/bin/httpd.worker -f /home/aureasys/webapps/ppr/apache2/conf/httpd.conf -k start
  492   492 21328 /home/aureasys/webapps/ppr/ S ?        00:00:32 /home/aureasys/webapps/ppr/apache2/bin/httpd.worker -f /home/aureasys/webapps/ppr/apache2/conf/httpd.conf -k start
 9066  9066   928 ps -u aureasys -O pid,rss,c R pts/1    00:00:00 ps -u aureasys -O pid,rss,command
22476 22476  1812 /home/aureasys/webapps/cda/ S ?        00:00:00 /home/aureasys/webapps/cda/apache2/bin/httpd.worker -f /home/aureasys/webapps/cda/apache2/conf/httpd.conf -k start
22477 22477  3416 /home/aureasys/webapps/cda/ S ?        00:00:00 /home/aureasys/webapps/cda/apache2/bin/httpd.worker -f /home/aureasys/webapps/cda/apache2/conf/httpd.conf -k start
22478 22478  3400 /home/aureasys/webapps/cda/ S ?        00:00:00 /home/aureasys/webapps/cda/apache2/bin/httpd.worker -f /home/aureasys/webapps/cda/apache2/conf/httpd.conf -k start
22479 22479  3632 /home/aureasys/webapps/cda/ S ?        00:00:00 /home/aureasys/webapps/cda/apache2/bin/httpd.worker -f /home/aureasys/webapps/cda/apache2/conf/httpd.conf -k start
22525 22525  1828 /home/aureasys/webapps/ie/a S ?        00:00:00 /home/aureasys/webapps/ie/apache2/bin/httpd.worker -f /home/aureasys/webapps/ie/apache2/conf/httpd.conf -k start
22526 22526  3420 /home/aureasys/webapps/ie/a S ?        00:00:00 /home/aureasys/webapps/ie/apache2/bin/httpd.worker -f /home/aureasys/webapps/ie/apache2/conf/httpd.conf -k start
22527 22527  3404 /home/aureasys/webapps/ie/a S ?        00:00:00 /home/aureasys/webapps/ie/apache2/bin/httpd.worker -f /home/aureasys/webapps/ie/apache2/conf/httpd.conf -k start
22528 22528 13684 /home/aureasys/webapps/ie/a S ?        00:00:00 /home/aureasys/webapps/ie/apache2/bin/httpd.worker -f /home/aureasys/webapps/ie/apache2/conf/httpd.conf -k start
25754 25754  1688 sshd: aureasys@pts/1        S ?        00:00:00 sshd: aureasys@pts/1
25755 25755  1568 -bash                       S pts/1    00:00:00 -bash

I've been todl that must be one process for every process in the crontab... but why do I have 4 exact process running at the same time?? Could be that my exceed of memory use??

aureasys@web151:~/webapps/ppr/ppr$ ps -u aureasys -O pid,rss,command | awk '{sum += $3} END {print sum}'
69608

My crontab -e: 4,24,44 * * ~/webapps/cda/apache2/bin/start 6,26,46 * * ~/webapps/ie/apache2/bin/start 18,38,58 * * ~/webapps/ppr/apache2/bin/start

1 2 * * 0 ~/webapps/ppr/dbBKUP/scriptdbBkUp

asked 20 Dec '10, 17:59

Luchi's gravatar image

Luchi
4137
accept rate: 20%

edited 20 Dec '10, 18:08

The reason you have more than 1 thread for each site is apache spawns child processes to take care of rendering the python into HTML. How many you need depend on the site and its traffic. Our documentation covers this,

http://docs.webfaction.com/software/django/troubleshooting.html#reducing-memory-consumption

The part about 'WSGIDaemonProcess'

(20 Dec '10, 19:07) johns ♦♦ johns's gravatar image
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×891
×82
×8

question asked: 20 Dec '10, 17:59

question was seen: 2,367 times

last updated: 20 Dec '10, 19:07

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2017 PARAGON INTERNET GROUP LIMITED
WEBFACTION IS A SERVICE OF PARAGON INTERNET GROUP LIMITED
REGISTERED IN ENGLAND AND WALES 7573953 - VAT REGISTRATION NUMBER 182147021
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM