Recently I have been playing around with Libuv. I don’t get the programming model as far as child processes are concerned. For example look at the following code: Here the output printed on console is: In my understanding uv_spawn acts like fork(). In child process the value of r is 0 and in parent process it is non-zero. So from
Tag: libuv
add another timer on already running loop
Given the following program – The second timer handle is never run on the loop, since the loop is already running, and “Timer2 called” is never printed. So I tried stopping the loop temporarily after running it and then adding the second timer – But this again didn’t work, probably because the later lines won’t be executed after 1st loop
Why node.js+mongodb does not gives 100 req/sec throughput for 100 req sent in a second?
I kept node.js sever on one machine and mongodb sever on another machine. requests were mixture of 70% read and 30% write. It is observed that at 100 request in a second throughput is 60req/sec and at 200 requests second throughput is 130 req/sec. cpu and memory usage is same in both the cases. If application can server 130 req/sec