I'm running a bunch of django apps on my shared host with an 80mb
memory limit.  I have a bunch of very low-traffic sites I want to keep
running, but use as little memory as possible, so my goal is to
minimize the memory usage for each of these very small sites.  I'm
just starting to learn about apache/python/django memory usage, so I
figure there's a lot I just don't know right now.

I'm running on webfaction with:
Apache 2.2.3 with the Prefork MPM
Python 2.5.2
Django 1.0.2 (as stated in webfaction's automatic setup, though django/
__init__.py shows VERSION = (1, 1, 0, 'beta', 1))

I'm measuring against the RSS.  A sample of one of my apps:

RSS    Command
3624   .../apache2/bin/httpd -f .../apache2/conf/httpd.conf -k start
15716  .../apache2/bin/httpd -f .../apache2/conf/httpd.conf -k start

In this case, I've got one apache supervisor process using a small
amount of memory (3.5MB) and a single worker process using a good
amount (15.3MB).  When I first start apache, the worker process starts
small (<4MB), but increases with the first page access (>12MB) and
stays there until the next restart.

Ideally, I'd like for the worker threads to release all the memory
they're using when idle to get back down to their initial memory
usage.  I realize that there will be some performance tradeoffs for
this, but in this case these sites have very low requirements so it
seems worth the tradeoff.

I've already played with apache's httpd.conf settings:
    ServerLimit 1
    StartServers 1
    MinSpareServers 1
In an effort to remove the second worker thread (so I have one process
using 13mb instead of two).  However, at this point apache still
spawns another process when usage spikes slightly, and then the second
thread remains until restart.

I've tried investigating apache MPM's, apache settings, and python
memory profilers, but haven't made much progress.  Some things I'd
like to try to figure out:
-What is using memory in my apache worker threads?  Is that the
baseline django memory usage, or are there ways to decrease this
minimum?
-What python techniques could I be using to decrease the long-term
memory usage? (not leaks, just persistent memory usage)
-What apache/wsgi config changes should I be looking into?  Different
MPM?

Any comments/suggestions are appreciated, I know I'm probably missing
some obvious things here.  Thanks.
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to