I've recently put up a newspaper site on Webfaction that was developed without much concern for memory limits--coming from PHP, my knowledge of memory issues is practically nil. Of course, Webfaction's plans all have memory limits, and we're currently on Shared 1, which imposes a 40MB limit. We're running the standard apache2/mod_python config, with media served via a separate apache2 process as Webfaction and the Django site recommends. The Debug setting has been set to False. I believe those are the standard steps recommended for reducing resource usage.
Here's a look at the ps output: PID RSS COMMAND 17122 19652 /home/---/webapps/django/apache2/bin/httpd -f /home/---/ webapps/django/apache2/conf/httpd.conf 19823 32232 /home/---/webapps/django/apache2/bin/httpd -f /home/---/ webapps/django/apache2/conf/httpd.conf 19824 30612 /home/---/webapps/django/apache2/bin/httpd -f /home/---/ webapps/django/apache2/conf/httpd.conf 4253 1808 sshd: [EMAIL PROTECTED]/2 4254 1456 -bash 5204 936 /bin/sh /home/---/scripts/mem-usage 5205 764 ps -u --- -o pid,rss,command 5206 708 awk {print $0}{sum+=$2} END {print "Total", sum} Total 88168 Presumably the three apache2 processes are the Django processes that actually count against the memory usage limit; they add up to about 80MB. Clearly there is a problem here. Because we don't yet have the domain for the site, traffic has been extremely low (basically just one person entering data into the site); I fear for the day we open up the site to everyone, mainly because I have no clue how memory usage will rocket when people start visiting the site on a regular basis. I also have no conception of what is "normal" memory usage for an application. For all I know, the complexity of the site may simply demand 80MB of RAM, and there might be nothing I can do about it. How I go about figuring that out, though, is a big mystery for me. So I guess my questions are: how do I optimize my Django setup to use less memory? Should I be looking at the Django project I built for ways to optimize the code, and what should I look for? Is there a general guide on optimizing Django applications, or at least some tips and tricks? And how can I audit the project I've built to figure out if 80MB is actually reasonable or if I should be able to crush it down further? (P.S. If someone has any idea what Webfaction means when it says you should be able to run "3 small Django sites" in 40MB, I'd love to know. What constitutes a "small site," anyways?) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---