Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

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.