Le 13/02/12 15:45, Chris McDonough a écrit :
> On Mon, 2012-02-13 at 15:00 +0100, Damien Baty wrote:
>>      Hello,
>>
>> While updating a small application to a more recent version of Pyramid,
>> I switched from Paste to Waitress for development. However, it looks
>> like Waitress cannot process two requests concurrently.
>>
>> The small application (attached) reproduces this. The 'slow' view calls
>> 'time.sleep(5)'. If a request is made against this view, Waitress will
>> enqueue other requests but will not _process_ them until the 'slow' view
>> has returned. The log shows that there are multiple threads that handle
>> all requests, but they do not appear to run concurrently.
>>
>> The same application ran with Paste ("WITH_PASTE=1 python
>> waitress_test.py") does not display the same behaviour: Paste does
>> respond to other requests while the 'slow' one is being processed.
>>
>> I wonder if the behaviour I have seen with Waitress is expected. The
>> "design" chapter in the documentation mentions a "pool of worker
>> threads" and it seems to imply that if a worker thread is busy, another
>> worker thread will process concurrent requests (at least that's how I
>> understand it), which does not seem to be the case. By adding a few
>> debug statements here and there, I saw that this behaviour is due to
>> "HTTPChannel.task_lock" being shared between all channels. But perhaps
>> all this is intended. Or I am missing something.
> 
> You're right.  I'll try to diagnose and fix this later.  I *think* the
> fix might just be to move the task lock constructor to the Channel
> __init__ but not 100% sure.  Thanks a lot for the succinct description
> and test program.

I did try that and all tests passed, but I was not sure whether it may
have negative side effects. (Also, I did not write a

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to