[prev in list] [next in list] [prev in thread] [next in thread] 

List:       uwsgi
Subject:    [uWSGI] [ANNOUNCE] completed the CGI plugin
From:       roberto () unbit ! it (Roberto De Ioris)
Date:       2011-12-11 17:58:46
Message-ID: 9627509960b67289e37c55d93ec705a4.squirrel () manage ! unbit ! it
[Download RAW message or body]


> On 12/11/2011 04:57 PM, Roberto De Ioris wrote:
>>
>>> On 12/11/2011 03:29 PM, Roberto De Ioris wrote:
>>>>
>>>> I suppose nginx users will be very happy about that
>>>>
>>>> http://projects.unbit.it/uwsgi/wiki/CGI
>>>>
>>>> Bye
>>>>
>>> That looks great :-)
>>>
>>> Will the threads only be used for cgi or also for other activities.
>>>
>>> I'd be looking for a setup with one django project and the means to
>>> occasionally run a few parallel cgi-scripts (php)
>>>
>>>
>>>
>>
>> if your python app is thread safe, you can safely mix wsgi and cgi in
>> the
>> same process.
>>
> I'm not 100% sure, that all the code (not all written by myself) is
> really thread safe.
>
> That's why I was curious how I could tell uwsgi to use threads for cgi,
> but not for the django project.
>
> At the moment I serve only this django project with estimated 1 to 3
> workers (still have to profile to find out the best compromise between
> perfomance and memory consumption)
>
> cgi would be a perfect match for the php scripts, that will not be
> accessed very often (once a day for a few minutes)
>

Maybe for your specific case the --cheaper option would be best suited.

Practically you configure uWSGI to have a maximum of N workers running,
but (if possibile) stay at a minimum of X


[uwsgi]
workers = 5
cheaper = 3
cgi = path_to_php
module = path_to_wsgi_app
...


With that config you will end with 3 processes running during normal
workload and 5 during the cgi phase (so you would be able to run up to 2
concurrent php scripts).

Another approach would be having a second uWSGI instance on another port
dedicated only to CGIs'


-- 
Roberto De Ioris
http://unbit.it

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic