4

I've been running a medium Django 1.1 site without issues, for about 2 years, on a Linux server with 2GB memory. I had to upgrade to Django 1.3 (on the same server) in order to run a specific app and of course to take profit of the new Django features! However I've been experiencing terrible memory issues since :(

I've noticed that for every hit there is a huge increase on memory usage. This can't be due to expensive requests, because even for very single views the memory usage is high (eg 40MB).

I'm using mod_wsgi and I'm not running django on Debug mode....

Even with a few tenths of hits, the memory gets filled, the server starts swapping and eventually dies...a temporary solution is to force apache restarts and reloads every time memory gets filled.

But i have to find where the leak is. Is it django or apache? Could it be that the default configuration (I've followed the how to on the django and mod_wsgi page) along with the apache configuration creates the problem?

Any advise on how I should configure apache+mod_wsgi options is more than welcome!

Cheers, N.L.

2
  • Did you change anything else? Update mod_wsgi, apache, python? Commented May 23, 2011 at 15:51
  • There are no known memory leakage problems with Apache/mod_wsgi and if the only thing you changed is your Django application then one would have to suspect whether your application code is compatible with Django 1.3. You should try and see if you can isolate issue to specific URLs within your application. Commented May 23, 2011 at 20:48

1 Answer 1

4

Try using some of memory profiling/analysis tools. At least for me dowser was of a great help. http://www.aminus.net/wiki/Dowser

So I've ended up integrating it more with django: https://github.com/munhitsu/django-dowser

Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.