WebFaction
Community site: login faq

Is normal that an aplication that doesn't have a data base connection neither some extrange things consume nearky 15 Mb of memory?? Because what I've is that. A very simple aplication that is consuming 15Mb of memory.... Or my code is realy, realy, realy, bad or django consume is excesive..

PD: I serve media in static way. This is the consume:

25770 25770  1808 /home/aureasys/webapps/cda/ S ?        00:00:00 /home/aureasys/webapps/cda/apache2/bin/httpd.worker -f /home/aureasys/webapps/cda/apache2/conf/httpd.c
25771 25771  3468 /home/aureasys/webapps/cda/ S ?        00:00:00 /home/aureasys/webapps/cda/apache2/bin/httpd.worker -f /home/aureasys/webapps/cda/apache2/conf/httpd.c
25772 25772  3452 /home/aureasys/webapps/cda/ S ?        00:00:00 /home/aureasys/webapps/cda/apache2/bin/httpd.worker -f /home/aureasys/webapps/cda/apache2/conf/httpd.c
25773 25773 15600 /home/aureasys/webapps/cda/ S ?        00:00:00 /home/aureasys/webapps/cda/apache2/bin/httpd.worker -f /home/aureasys/webapps/cda/apache2/conf/httpd.c

Here is consuming near 25Mb..... That's no good...

asked 21 Dec '10, 07:26

Luchi
4147
accept rate: 20%


That is fairly normal behavior of Apache. Your application requires that you run your own Apache instance. So, even though it is not connecting to a database, Apache has to run at all times to listen for connections.

Serving static media from a static only application is a good start. We have instruction at the following url that will help limit memory usage for a Django application:

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

permanent link

answered 21 Dec '10, 08:06

aaronh ♦♦
1.3k3
accept rate: 34%

Yes, I've read and done almost everithing in that guide. So with a plan of 80 Mb limit I can have aprox 3 app...... It will be expenseive :) jeje

PD: what i can't do is to reduce the number of processes for app. I want to reduce to 2. This is my httpd.conf

ServerRoot "/home/aureasys/webapps/cda/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_cda.log combined
ErrorLog /home/aureasys/logs/user/error_cda.log
KeepAlive Off
Listen 24852
MaxSpareThreads 3
MinSpareThreads 1
ServerLimit 1
SetEnvIf X-Forwarded-SSL on HTTPS=1
ThreadsPerChild 5
WSGIDaemonProcess cda processes=2 python-path=/home/aureasys/webapps/cda:/home/aureasys/webapps/cda/lib/python2.6 threads=1
WSGIPythonPath /home/aureasys/webapps/cda:/home/aureasys/webapps/cda/lib/python2.6
WSGIScriptAlias / /home/aureasys/webapps/cda/cda.wsgi
permanent link

answered 21 Dec '10, 09:15

Luchi
4147
accept rate: 20%

If you comment out the WSGIDaemonProcess line altogether, mod_wsgi should work in "embedded" mode and it would not have processes of its own. This should bring down the number of processes to 2.

(21 Dec '10, 09:18) tie
Your answer
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:

×900
×83
×1
×1

question asked: 21 Dec '10, 07:26

question was seen: 2,737 times

last updated: 21 Dec '10, 09:18

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM