Re: [nodejs] One million HTTP Comet connections on singe Node.js server and some thoughts about it.

700 views
Skip to first unread message

Ben Noordhuis

unread,
Aug 15, 2012, 4:29:43 PM8/15/12
to nod...@googlegroups.com
On Wed, Aug 15, 2012 at 10:12 PM, Alexander Shtuchkin
<ashtu...@gmail.com> wrote:
> 2. *The* Idle Notification. I've made some research about it in node
> codebase. The algorithm was last modified 2 years ago, somewhere around
> version 0.1.94 and I think must be updated to reflect current V8 best
> practices. I summarized current code here: https://gist.github.com/3363081.
> Most evident problem here is that node is sending IdleNotification every 5
> seconds when HeapTotal > 128M no matter what. This exact behavior is making
> a lot of node practitioners disable the idle notifications and have better
> results when lots of memory is needed (my test showed this very clear).
> I'm willing to do a pull request to change this behavior after discussing
> here what algorithm should be implemented instead of the current one.

The idle notifier is due to be revised (though that won't land in
v0.8, being a potentially disruptive change).

Bert Belder

unread,
Aug 15, 2012, 6:50:40 PM8/15/12
to nod...@googlegroups.com


On Wednesday, August 15, 2012 10:12:51 PM UTC+2, Alexander Shtuchkin wrote:
2. *The* Idle Notification. I've made some research about it in node codebase. The algorithm was last modified 2 years ago, somewhere around version 0.1.94 and I think must be updated to reflect current V8 best practices. I summarized current code here: https://gist.github.com/3363081. Most evident problem here is that node is sending IdleNotification every 5 seconds when HeapTotal > 128M no matter what. This exact behavior is making a lot of node practitioners disable the idle notifications and have better results when lots of memory is needed (my test showed this very clear).
I'm willing to do a pull request to change this behavior after discussing here what algorithm should be implemented instead of the current one.

I think he bigger problem here is that once the idle notification kicks in it keeps running until v8::IdleNotification returns false. In between runs node will do *some* event processing, and some v8 heap allocations happen. Therefore, it's likely that v8::IdleNotification keeps getting called until the server is really idle again (which might never happen).

Alexander Shtuchkin

unread,
Aug 16, 2012, 9:03:29 AM8/16/12
to nod...@googlegroups.com
Agreed, this might be a problem.

Also, do you know anything about the 1-st issue I mentioned? The RSS memory is not reclaimed to OS.
Reply all
Reply to author
Forward
0 new messages