Super User is a question and answer site for computer enthusiasts and power users. 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 need to run many Python web apps (mostly Django, but not all of them) on a server. Currently I'm running them with uwsgi emperor mode (I guess... I just have all configs in /etc/uwsgi/apps-enabled/) with such configuration:

[uwsgi]
thread=3
master=1
module = ...
chdir = ...
socket = ...
logto = ...
uid = ...
gid = ...
chmod = ...
single-interpreter = true
enable-threads = true

(Last two lines are mandatory for New Relic)

The problem is, there're quite a lot of these apps and most of the time there is only one or two what's used. Maybe there is a way to run them to minimize consumation of processor time by unused apps? Right now even if noone is using any of the apps the load level can simply be more than 1.0.

share|improve this question
1  
That is the job of the OS. – soandos Jun 20 '12 at 11:25

Try adding

cheap = true

idle = 60

this will put instances in "cheap mode" (only the master will run) after 60 seconds of inactivity. They will respawn after the first request.

If you are on a recent linux kernel you may want to experiment with ksm (check uWSGI wiki homepage)

share|improve this answer
    
thanks a ton. I'll try and accept your answer if it helps – valya Jun 21 '12 at 21:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .