Node.js memory benchmark confirms V8's GC may not be ready for the server
hns.github.com
hns.github.com
Anyway, this could be a legit complaint at this point.
I explained why that happens in my comment to the original post.
1) one with Buffers is also causing mark-sweep/compact pauses (7-15ms each) because Buffer constructor calls AdjustAmountOfExternalAllocatedMemory which triggers full gc cycle if it thinks that too much memory is held outside V8.
2) GCs in string based benchmark are mainly scavenges taking 0 ms plus < 10 full collections taking <6ms each on my desktop.
That is all I can say. V8 GC is performing well here from my point of view.
Updating your post sounds like a nice idea. It created a lot of confusion among developers.
Strictly speaking I am not even convinced that GC is bottleneck here. Only profiling can reveal the real bottleneck.
[I tried small experiment: used thirdparty pure-JS JSON parser instead of V8 JSON.parse --- that changed GC profile, but did not affect response time.]
My guess is that node's GC configuration isn't finely tuned for 25KB structures or maybe the GC is called prematurely.
Some suggestions: try to turn off the GC and re-do the benchmark, try with smaller JSON datastructures, try with different versions of node. Each of these would give more evidence where the problem is.
Btw. in that benchmark: which versions of RingoJS and node.js are used? How much memory does each server use in the end?
Edit: What type of garbage collector does RingoJS/Rhino use - how is the GC configured for RingoJS?
The JSON I'm parsing is just objects with short string properties (around 10 characters). There's just one longer 25kb JSON string but that is never collected. As to Node configuration, can you provide some specific options to use? I've been asking about this on #node.js (and ryan) and I'm open to any suggestions.
Ringo is running with the server hotspot JVM without any further options.
I think my benchmark and the conclusions I draw from it (after a lot of thinking) are fair. My intention is just to make people see there's no magic bullet with performance or scalability, and that there are alternatives for server-side JavaScript.
V8 GC is a well known concern in the Node community, but it's still performing well enough that Node is considerably faster than traditional servers (like Apache). The fact that Ringo is also faster doesn't make V8 "not ready" it just means it could be improved.
If I wanted to be contentious I could suggest that "Hacker News comments confirms that RingoJS may not be ready for developers" because the author likes taking pot shots at other frameworks. But that would be petty, wouldn't it?
Well said. Most of us fail to realize this simple point until someone points out.
Second to make this a fair comparison, you need to use a similar sized heap. It could be, that the JVM heap was large enough to run the whole test without a major CG. We need a GC log also for this part of the test.
Sun was aware of the different CG strategies needed for server and client use and let us choose between them. V8 however seems the be optimized for the client side.
It would be a lot of work to abstract the js core.
* whitebeam http://whitebeam.org/, which to my surprise appears to be not actually dead yet.
* jaxer http://jaxer.org/
* couchdb
But none of these seem to be low level enough to make a reasonable comparison.
Flusspferd http://flusspferd.org/ seems most like node, but using spidermonkey (circa Firefox 3.5, it seems, but actively maintained, so there's hope for future enhancements). Unfortunately, it doesn't yet seem to have all the handy web serving stuff that node has, so probably still not useful for a competitive benchmark.
The original Palm Pre only has 256MB of RAM and had plenty of "out of mem issues" prior to homebrew adding compcache
http://earl.strain.at/2010/ringo-node-benchmark/buffer-alloc...
(This uses the very same dataset underlying the "buffer alloc" graph in the original post.)
Can the performance issues be solved by adding hardware? (or spin up more node processes so that each one stays at the bottom of the curve?
I've just confirmed I may have solved cancer.