when long polling, Why are my other requests taking so long?

Posted by Pascal on Stack Overflow See other posts from Stack Overflow or by Pascal
Published on 2010-04-17T08:55:49Z Indexed on 2010/04/17 9:03 UTC
Read the original article Hit count: 458

Filed under:
|
|
|

The client makes 2 concurrent requests. (1 which takes 60 seconds - long polling) and another which is NOT long polling - supposed to return right away. It does return right away when I'm not doing long polling. But as soon as I start doing long polling with the other thread, the other one takes forever to execute.

Firebug shows that the request is waiting for 10-50 seconds. On the server, I profiled ALL requests from the moment the php script starts to the time it goes back to the client, and it shows that each one only took 300ms or less.

This problem started about the same time I started doing long polling (with the other XHR requests). I'm using jquery for both requests.

The server shows that it is under very light load. CPU and memory less then 2%. 8 processes running out of a pool of 15. (it doesn't seem to deviate much from that number 8, even when I run more ajax requests). I guess each process can run multiple ajax threads concurrently.

I made sure to EXIT from all processes as soon as their done executing. I don't see how the process pool has run out, if there are still 7 unused processes listed under prstat -J. Also, the problem happens somewhat intermittently. Firefox should be able to handle 2 concurrent ajax requests. i dont get what the problem is.

© Stack Overflow or respective owner

Related posts about comet

Related posts about AJAX