On Wednesday, January 8, 2014 1:15:28 AM UTC+5:30, Saúl Ibarra Corretgé 
wrote:
>
>
> > 
> > Hi  Sa�l, 
> > 
> > I tried as you suggested by not using uv_work_queue and doing just 
> > uv_write on the read callback and then hammering with thousand 
> > connections and requests. 
> > It works absolutely perfect and I also get other callbacks (after_write, 
> > TTY callback) 
> > 
>
> Ok, so the problem seems to come from the threadpool thing then. 
>
> > ( However, the echo server is just for test purpose. In production 
> > scenario I have to have worker threads to do CPU bound processing on all 
> > incoming requests before I send results to client(s) ) 
> > 
>
> I see. 
>
> > Now I still didn't get any clue,   with massive incoming requests from 
> > thousands of clients, after doing uv_work_queue calls why only read 
> > callback works and other are inactive? 
> > 
>
> Looks like the after work callbacks are not getting called for some 
> reason. I'm no windows expert, and I don't see any obvious bug in the 
> windows code, so I really have no clue here :-S 
>
> Maybe using the same threadpool for Windows (using the one we have for 
> Unix, that is) would be better. Have a look at this issue comment: 
> https://github.com/joyent/libuv/issues/649#issuecomment-14726848 
>
> It shouldn't be difficult to port the Unix threadpool to Windows, but 
> AFAIK no one is working on it at the moment. 
>
>
> Cheers, 
>
> -- 
> Sa�l Ibarra Corretg� 
> bettercallsaghul.com 
>


Hi Saúl,

It seems there is inconsistency involved in here. I repeated your told 
"uv_write on the read callback itself without having uv_work_queue" 
experiment again today for multiple times in sequence. And I found that the 
execution was not consistent each time. 
Sometimes it is perfect but sometimes (rather abruptly) after_write 
callbacks suddenly starts getting too much delayed. (Same is for TTY 
callback) 
That delay causes not freeing up allocations, resulting in huge memory hog. 
(Note: uv_write does never returned any error)

What I observed additionally is that when the things are in perfect order, 
CPU utilization of System (OS kernel) and server (my code+libuv) are 50% 
50% each.
But when it starts delaying after_write callback, CPU for System goes down 
to 7 percent while server is still at full throttle.

Now what could be reasons for this abrupt behavior. (By the way, I run  
simulator and server on same machine. But I hope that shouldn't contribute 
to this?)

Tnx,
Ashish

-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to