Hi,
Any recommendations for the following would be much appreciated:
>>
>> 1. Monitor the 'health' of the NodeJS event loop, to know 'how big the
>> problem is' – any extended blocking of the event loop is a Bad Thing, so
>> seems a Good Practice to detect when blocking happens.
>>
>
As a very simple health-check, do the following:
function timeTick() {
> var startTime = (new Date().getTime());
> function onTick() {
> var interval = (new Date().getTime()) - startTime;
> if(interval > 5)
> console.log('timeTick(): WARNING: interval = ' + interval);
> }
> process.nextTick(onTick);
> }
> setInterval(timeTick, 1000);
This simply sets up a periodic timer that checks the interval between one
tick and the next. Set the threshold (5 above) to be a value that
represents the kind of latency that you consider problematic for your app.
It doesn't tell you what's causing the problem but you'll quickly get an
idea of what circumstances are triggering a problem.
Paddy
--
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