-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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: unexpectedly slow initialization #50511
Comments
The That seems to imply that the latency is going into something CPU-bound, and the fact that the reported If you add a |
Take a look at the strace log, it seems stalled after reading a large host file (14M) .
I've tested on my Linux box, parsing 19M host file(655360 lines with same host name) takes 800ms for the first time and 3ms for second time. |
@bcmills maybe we can change title to: "net: takes too long to parse *nix host file" ? |
For me with an
|
Here is trivial program that makes GET request:
When compiled and run on Darwin system (using binary distribution), it have more or less expected performance -- twice as slow compared to curl.
But when I compile and run it on my Linux box (
Linux void-live 5.13.13_1 #1 SMP Fri Aug 27 13:28:13 UTC 2021 x86_64 GNU/Linux
),also using binary distribution, I get following results:
Difference is much bigger. This time seems to come from some one-time initialization -- second request made in same program is fast. Here is annotated strace. It looks like it is doing many "rt_sigreturn" calls, but this is just my guess.
I have access to another linux box, with unusual kernel (lacking madvise(2), for example), which have more of the same problem: first request takes around 4 seconds, any subsequent work as expected.
The text was updated successfully, but these errors were encountered: