Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running several django sites on uwsgi, and I'm attempting to optimise my configuration for memory usage, but the --idle and --die-on-idle flags don't seem to be doing anything.

Each daemon starts off at around 10-12MB and increases to around 30MB once it has served a request, but then stays there even when idle for some time. My startup command is:

uwsgi --cheap --idle 60 --die-on-idle --http :8083 --wsgi-file /var/django/mysite/apache/django.wsgi

Is there anything I'm missing here? From the docs, I'd expect the "--idle" flag to make it drop back to its initial memory usage after 60 seconds of idleness; and I'd expect the "--die-on-idle" flag to kill the worker process completely at that point. Neither of these happen, although the "--cheap" flag does seem to work.

(Note: I realise http isn't the best protocol but I want to get the memory issue sorted before I recompile nginx)

share|improve this question
up vote 1 down vote accepted

you need the master process to have those options working. If you want to use the http protocol, use --http-socket instead of --http (that will create another process). In addition to this give a look at KSM on the uWSGI wiki

share|improve this answer
Cheers, --master was what I needed. I must say the docs are a bit lacking in detail! – Greg May 15 '12 at 2:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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