New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/http: HTTP/1.1 performance degradation in 1.15beta1 #39543
Comments
Can you use the net/http/pprof package and collect CPU profiles from both versions? Thanks. CC @bradfitz |
Attached on both versions. |
Thanks. Unfortunately I don't see the problem. I'll mark this as a release blocker for now. I hope that somebody will be able to find what changed. Can you share the code that you are using for benchmarking? Thanks. |
Sure, the following example:
|
I can confirm that I see a difference in 1.14 vs. 1.15beta1. Linux, amd64, GOMAXPROCS(1), the above test program and ten runs each of
With default GOMAXPROCS, the difference was less pronounced. Nothing obvious to me in profiles. Will look further. |
I took a stab at reproducing this just now, 1.14 vs 1.15tip, Linux, amd64, 12 processor box but GOMAXPROCS=1. 30 repetitions of 10 seconds of work:
Comparing averages, tip is 0.3% slower, comparing medians, 0.1% slower. Got curious about what had changed since beta1, and noticed:
Benchmarked again at f84bbd5 (just before the change to net/http), and now it's 4% slower. I will try the same experiment later today on a Mac laptop, once I am done using it for meetings. |
I tried the comparison on a Mac laptop, Chrome and IDE shut down, but the numbers (30 repetitions of 10-second runs) were too noisy to be useful. I need to try again, very carefully, but I it would be nice if the bug filer could try tip and see if things look better, since (once!) they seemed better for me on Linux. |
FYI, I ran a second experiment on Linux (same machine, but this time using "perflock" for the benchmarked server).
First, it looks like the bug is indeed reproducible against f84bbd5. Notice how there's not much difference among either group of 5, max/min is under 1%.
It also looks like the bug is fixed at tip, and also that there's more noise among the runs at tip (same numbers for 114). Note that I am taking maxs and mins of numbers that are already medians or averages, and I was using perflock, so this is a little interesting, maybe some service process woke up during the benchmarks.
That is, I believe the bug is consistently reproducible on my pretty-quiet (office-quarantined) deskside box, and it has also been fixed, most likely by the first commit after f84bbd5 but perhaps by a later one. |
I reproduced this with results similar to what's posted above on a macOS laptop, and I don't have much new information to add. The difference between 1.14.4 and tip (3b2f67a) is very small compared to the variance of the micro benchmark, especially without artificial restrictions such as GOMAXPROCS=1, and I wasn't able to narrow it down further. It seems to correlate to the various changes to net/http between 1.14 and tip (https://github.com/golang/go/commits/master/src/net/http), most of which were minor strictness/correctness improvements, and none were optimizations. Perhaps someone else can narrow it down further or more conclusively, but I did not find an actionable issue here. |
Any reason not to close this? |
Closing for now. If there are still issues please feel free to comment and/or re-open. |
I am seeing 5% performance degradation when benchmark HTTP in plaintext on macOS Catalina. Ran test more than 3 times shown lesser 500 requests per second on 1.15beta1.
Simple hello world test on both 1 core:
go1.14.4 darwin/amd64
go1.15beta1 darwin/amd64
The text was updated successfully, but these errors were encountered: