-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Significant performance regression in http in v0.10.32+ #8940
Comments
Shouldn't |
I tested with Apache Bench (
I have to say that I've never worked with Could you try it for a longer period ? |
The length of time has no bearing on speed (or at least it shouldn't). Anyway, I tried durations of 3, 10, 30, etc. for the fun of it and it's still approximately the same dismal performance. |
Indeed, normally it shouldn't have much impact, but I wanted to get it out of the way. Could you try with Apache Bench as well ? On Ubuntu it should be |
He is not alone. I had the same issue on production with up to 20k qps. Did some profiling to see what's wrong and it seems that response just slows down. In my case: from 1ms to 30ms. Tried different versions of node and the last one that is not affected is v0.10.31. I think it is related to 1fddc1f Also note, that my system is using keep alive and chunked content. This is kind of a serious issue with such a huge performance impact. Strange, that no one noticed. Maybe there's a specific way of using http server for this to occur? Stripped down version of my http server:
|
@CGavrila So far I'm only able to reproduce it with wrk. ab isn't a good test for this issue I think because it only does http 1.0 and also only does keep-alive for non-chunked responses. To trigger the slow path introduced by 1fddc1f, (as far as I can tell) there needs to be both keep-alive and chunked responses. |
I can't say for sure that the issue is Node's fault, but wrk has a strange quirk that causes massive slow down. As you can see from the ab benchmark (and it would be faster if /cc @tjfontaine |
@joyent/node-coreteam Added to the 0.10.37 milestone as it seems to be a significant performance issue for which we seem to have a good candidate fix. |
A significant performance regressions has been introduced in 1fddc1f for GET requests which send data through response.end(). The number of requests per second dropped to somewhere around 6% of their previous level. (nodejs#8940) The fix consists of removing a part of the lines added by 1fddc1f, lines which were supposed to affect only HEAD requests, but interfered with GET requests instead. The lines removed would not have affected the behaviour in the case of a HEAD request as this._hasBody would always be false. Therefore, they were not required to fix the issue reported in nodejs#8361.
A significant performance regressions has been introduced in 1fddc1f for GET requests which send data through response.end(). The number of requests per second dropped to somewhere around 6% of their previous level. The fix consists of removing a part of the lines added by 1fddc1f, lines which were supposed to affect only HEAD requests, but interfered with GET requests instead. The lines removed would not have affected the behaviour in the case of a HEAD request as this._hasBody would always be false. Therefore, they were not required to fix the issue reported in nodejs#8361. Fixes nodejs#8940. PR: nodejs#9026 PR-URL: nodejs#9026 Reviewed-By: Julien Gilli <[email protected]>
I just noticed a slowdown since 1fddc1f (v0.10.32+). Before this commit, I was getting ~14-15k req/s with my custom http server, after this commit I get ~1.2k req/s. I tested with v0.11.14 and the slowdown does not exist there.
My performance test consists merely of:
I am using wrk to hit this server like so:
The text was updated successfully, but these errors were encountered: