I've got a django app running through mod_wsgi on Apache 2 (Worker) behind an Nginx reverse proxy (also serving static content). When the app starts to get a bunch of hits concurrently, memory usage will spike from <20% to >96% and the whole application grinds to a halt.
Here are my Apache WSGI configs:
WSGIDaemonProcess djangoboss user=django group=django processes=2 maximum-requests=500 threads=1 python-path=/home/django/django_env/lib/python2.6/site-packages display-name=%{GROUP}
WSGIProcessGroup djangoboss
WSGIScriptAlias / /home/django/django/wsgi/django_wsgi_handler.py
Here to is output from htop:
PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
29551 django 20 0 793M 745M 6868 R 61.0 42.8 1:28.65 (wsgi:djangoboss) -k start
29550 django 20 0 793M 745M 6868 S 0.0 42.8 0:00.01 (wsgi:djangoboss) -k start
29549 django 20 0 793M 745M 6868 S 0.0 42.8 0:00.00 (wsgi:djangoboss) -k start
29548 django 20 0 793M 745M 6868 S 0.0 42.8 0:00.00 (wsgi:djangoboss) -k start
30778 django 20 0 192M 176M 6356 S 0.0 10.2 0:12.15 /home/django/django_env/bin/python /home/django/django/manage.py post_content
27544 django 20 0 86028 43160 6892 S 0.0 2.4 0:00.01 (wsgi:djangoboss) -k start
27545 django 20 0 86028 43160 6892 S 0.0 2.4 0:12.92 (wsgi:djangoboss) -k start
27542 django 20 0 86028 43160 6892 S 0.0 2.4 0:00.00 (wsgi:djangoboss) -k start
27543 django 20 0 86028 43160 6892 S 0.0 2.4 0:00.00 (wsgi:djangoboss) -k start
I've tried loadbalancing with a second Apache server behind Nginx, but that didn't seem to help much.
The server is Ubuntu 10.04 with apache/mod_wsgi/nginx all installed from the ubuntu repos. Django app is running on Django 1.2.
Any ideas?