I've got a VPS (Ubuntu 10.04, 512MB) on which I host 10-15 django sites, most of which have intermittent traffic. I'm wondering what the best hosting technique is in this situation, where the processes are mostly sitting idle.

Currently, I've got nginx as my frontend, with apache/mod_wsgi serving the django application, and inactivity_timeout set to minimise memory consumption in the idle processes. Is this the best option still? I've read a bit about gunicorn and uwsgi, and while they seem to offer some advantages, there seems no way to keep the memory consumption of their processes down when idle.


Are you sure you have read the uWSGI docs ? With over 300 options, it would be sad not having such a useful feature. Check --idle option, it does exactly what you need :)

I suggest you to run uwsgi --help too (from the command line), maybe some other parameter will catch your attention

  • Actually, I must confess I didn't read them very thoroughly, I'm more familiar with Gunicorn. Thanks for the tip, I'll give uwsgi a go and see how it works out. – Greg May 10 '12 at 21:24
  • I've got a few sites running on uwsgi, and have tried various combinations of the cheap, idle and die-on-idle options, but the memory usage is staying high. Anything obvious I could be missing? I'm proxying from nginx to uwsgi via http for now, but I didn't think that would make a difference memory-wise. – Greg May 10 '12 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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