I am here to answer questions. I will start by sharing some implementation details:
- we use long polling, but will add WebSocket support once we get more browsers that support it. The code to make it work is shared here: http://amix.dk/blog/post/19489
- we had a smaller comet system in the past that was based on Java + JBoss Netty. It didn't scale that well (used ~10x time the memory node.js solution and had a lot of quirks, like lost connections). Generally thought Netty worked "ok", but I would recommend anyone doing anything serious to look at node.js
events in browsers and
closures are a natural part of the language, e.g.
how do you access data storage backend (redis, memcached, your lightcloud and mysql) wth node.js? any suggestions?
Edit: plus, I am confused about the presentation on comparison with Tornado slide. It seems Tornado has higher transfer rate. And after all, they just do a thin layer on top of epoll, what's the penalty here?
It will since you don't need to open and close connections all the time. I can't estimate at what degree, but I think the communication will be much faster since currently some time is used to re-create connections.
How many node JS instances are you running on this machine? I am guessing 4? 1 per core and each one is aimed to handle 50k idle connections? And if you are running more then one, how are you load balancing them? Nginx?
Also I would like to note I saw your Tornado vs Node.JS hello world test and it made me curious because we use Tornado and we really believed that it was the fastest.
So I looked at your results and noticed Tornado had 100x more bytes transfered in your AB test. So I decided to run your same test on a raw Tornado HTTP server (not using the web.py framework) and these were the results of Hello World.
Like noted in that benchmark it's non scientific and it should be taken with a grain of salt - - like any other benchmark. It should be said thought that I have evaluated both Twisted and Tornado on a lot of open connections in production and they did not scale (capped on CPU and used too much memory).
Also regarding node.js we run around 8 I think and we plan to introduce more as node.js does not have threads or processes and currently our CPU and memory usage is very low. They are load balanced from our Python servers, but nginx would be a good load balancer as it's non-blocking.
It should be said that I have coded a lot in Python and I love Python - - so I don't have any bias and I would gladly use Python if it could scale.
I think the speed you see as a difference may be coming from how you're writing the data, node requires multiple function calls to do the writing of data (unless you use a raw tcp socket), tornado appears to just take it all in one function call, which takes in a string.