Hello Rob, thanks for the reply. I think you suggestion is great, but my code is very small, has just 2 or 3 connections to the outside and in my tests I use them all, so when I run 1 testserver it does every connection and executes correctly all the callbacks. For example, in my test server I have:
function a connects to server A then on the callback it calls function b function b connects again to server A then on the callback it calls function c function c connects to server B and the callback either start function a again or calls function d function d connects again to server B and I print what I receive from the server. This is more or less what I do. The problem is that all of this is done x times, where x is the number of connections per testserver I setup when I run my tests. If x is great enough (500 to 1000) and the number of testservers I run in parallel is great enough too (250 to 1000) then sometimes there are those message loss, where eventually, when everything ends, I get printed from the final callback only 90 to 95% of the results, and the other testservers remains stuck somewhere (ps aux | grep node shows them stuck in the middle of something) and eventually dies for timeout. I hope this is clear enough, if it's not please tell me, I'll try to be more specific about it. Do you understand better the problem now? Thanks, Masiar P.S. I'm running all the testservers on a 10-core machine with 64GB ram and 2 processors (5 core per processor). Both server A and B are on one processor occupying one core each, while testservers are on the other processor running on all the 5 cores. On Apr 5, 2:05 pm, Norbert <[email protected]> wrote: > Am Mittwoch, den 04.04.2012, 08:12 -0700 schrieb Masiar:>[ Seldom Pending > connections ] > > My question is: where did this small percentage of clients got lost? I > > can see the log of the server and after the majority of connections > > finishes, the server doesn't log anything else, like it's not > > receiving anything. My thought is that the server lost some connection > > while dealing with the others. The server is not simply answering with > > hello world, it's performing operations and connecting to a database. > > Moreover every client does more than one connection to the server > > (once one finishes another one starts, it's the flow of my > > application, at least 2 connections per client). > > > What do you guys think? > > > Masiar > > Very often this sounds like a forgotten callback call. > e.g. > var server = http.createServer (function (req, res) { > a.doSomething (function () { > b.doSomething (function () { > // reply request > }); > }); > > }) > > Now if b.doSomething forgets to callback (happens often on error cases); > you are stuck with a pending connection. > > What can you do? > - Check your code > (e.g. return "error"; instead of return callback (error)) > - Check your libraries code (I had similar problems with older versions > of the mysql library) > - Do some monitoring: > function onRequest (req, response) { > var timeout = setTimeout (function () { console.log ("This call took > very long!"); }, 10000); > a.doSomeComplicatedOperations (function () { > clearTimeout (timeout)) > // do the response > }); > > } > > Greetings, nob -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" 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/nodejs?hl=en?hl=en
