4 ms·
Does anyone have any idea how it would compare performance-wise to what's out there right now? vs Nginx for example.
by weixiyen 16y ago
Does anyone have any idea how it would compare performance-wise to what's out there right now? vs Nginx for example.
- sh1mmer 16y agoRy has some Nginx / Node comparison in his JSConf slides http://nodejs.org/jsconf2010.pdf http://nodejs.org/jsconf2010.pdf Summary: Node isn't quite as fast as NginX but it's close, and it's programable, and he's still tuning it.
- andrewvc 16y agoEDIT: After looking at this http://nodejs.org/jsconf2010.pdf http://nodejs.org/jsconf2010.pdf from sh1mmer's post, it looks like I need to be using a Buffer object to serve data over 64kb due to v8's garbage collector making a performance mess when using strings. EDIT2: After looking at the code again, file reads come in as strings, so I don't actually see that Buffers would help, at least until the node file API starts passing around buffers instead of strings. I can't speak to performance wrt to proxying, but I benchmarked its performance serving files recently[1]. Now, I didn't benchmark nginx, but as you can see, its pretty slow at that task, averaging ~10 MiB/s on fairly decent hardware, across a single gigabit switch. One problem node has, is that it sucks dealing with strings containing non UTF-8 data: From the node docs: Node supports 3 string encodings. UTF-8 ('utf8'), ASCII ('ascii'), and Binary ('binary'). 'ascii' and 'binary' only look at the first 8 bits of the 16bit JavaScript string characters. 1. http://blog.andrewvc.com/nodejs-can-really-scale http://blog.andrewvc.com/nodejs-can-really-scale