Hello guys, just wanted to share my findings when making a 1 million connections test. The main article is in Russian ( http://habrahabr.ru/post/123154/), but I'll tell some details here.
First of all, what surprised me is that 1 million goal is not only possible in Node v0.8, but is also easily achievable. I didn't do any specific tuning to make it possible and I believe any modern server can do that. 80% of code that I wrote in this test was about measuring system parameters. The main server part is basically a 'cluster' module tutorial. All the code is shared: https://github.com/ashtuchkin/node-millenium, with description of steps needed to reproduce the test (it's really not hard) and some CPU/Memory graphs. I used AWS EC2 to launch 40 instances in 3 regions which made 25000 connections each. It is much easier than messing around with several ip addresses and fake network interfaces. What I wanted to ask is: 1. After the test, node says that its heapTotal (green/blue stripe on memory graphs) is small, while the RSS is rather large (about 2 Gb for all workers, yellow stripe). This memory is reused when I do another test as you can see in this graph<https://a248.e.akamai.net/camo.github.com/98c2393032810ab9667946bbc652525ec527d0f4/687474703a2f2f73332d65752d776573742d312e616d617a6f6e6177732e636f6d2f68616272312f6c6f67346d656d2d656e672e706e67>, but it isn't reclaimed to the OS. What could it be? Why does it behave like this? 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. Thanks Ryah, Isaac and all Node.js and V8 developers for making this happen. -- 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
