Hi Roberto,

On 02/19/2012 06:36 AM, Roberto De Ioris wrote:
> 
>> At the moment nuwsgi is configured to handle ONE django project
>> with 4 processes.
>> This django project is rather busy and there should always be processes
>> ready to handle requests.
>>
>>
>> Now I'd like to add three more django projects to my setup.
>>
>> Theseprojects would be rarely used (once per day for a few minutes) and
>> performance / response times is not that important.
>>
>> So ideally these three projects should only be loaded to RAM when the
>> first request occurs  and the memory should be released after some
>> minutes of inactivity.
> 
> The are various way:
> 
> [uwsgi]
> socket = <your_address>
> ; start without workers
> cheap = true
> ; load the app only on worker spawn
> lazy = true
> ; shutdown workers after 60 seconds of inactivity
> idle = 60
> ; load the app
> module = your_django_app
> 
> On "idle" such an instance should consume from 2 to 3 megs of RSS memory.
> You add such a file for each of the "tiny" django app. You can then manage
> them with the emperor.

Sounds reasonable.
I have to play though a little with emperor mode, as I never used it so far.

> 
> Another approach (more aggressive as only one process for all of the
> "tiny" apps is used):
> 
> [uwsgi]
> socket = <your_address>
> ; spawn max 4 workers
> processes = 4
> ; leave 1 worker always running
> cheaper = 1
> ; recycle workers after each request
> max-requests = 1
> 
> You then define the apps in nginx using UWSGI_SCRIPT. At each request the
> app is loaded in uWSGI and then removed. To avoid much wait during
> startup, the cheaper mode is used, allowing processes to be started on
> demand.
> 

I''ll try both options. The more aggressive approach would probably be
performat enough for whatI am trying.

> There are other ways but they requires uWSGI 1.1
> 

Could you just mention the name of the new 1.1 feature, that you would
suggest I can then read up, though I will probably only use it when
uwsgi 1.1 is a little 'older'


Thanks a lot again.


_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to