-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
httpClient: enormous performance issues when sending body. #24741
Comments
Me neither but can you please create a PR with this fix? |
Sure I can create a PR. But is it really the right fix ? |
Add:
after this line. I verified that fixes the issue or at least one issue... hard to say because there was no code provided :) Edit: better do it after the |
@nitely : thank you very much, you were completely right in the analysis. Setting the option after the first call to Can we / shall we make this fix on the std/httpClient ? (portability, potential drawbacks in other cases ?) |
Some comparaison to existing library :
On the other side, POCO HTTPSession (which is higher lever, as nim httpClient could be) set it unconditionally
So i presume we should do it. |
Not sure, I think we could add a way to enable/disable tcp_nodelay in Also, you probably want to add your initial fix as well. Also note I'm just a nim user :), core devs may have a different idea. |
Nim Version
Nim Compiler Version 2.2.0 [Linux: amd64]
Compiled at 2024-10-02
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: 78983f1
active boot switches: -d:release
Description
Basically when using
request
proc, performance are catastrophic as soon as there is a body (even if the body is extra small).This can be reproduced quite easily.
Running both client and backend on the same machine.(bottleneck is not network).
Tested with 3 various backends (one using asynchttpserver, one using mummy, one implemented in C++ Boost/Beast), all tested where showing the same behaviour.
I have also eliminated all other possibles bottleneck..
See here (6789 is the port)
=> a run with 1000 requests with a body size of 10 bytes
=> a run with 1000 requests with no body
Current Output
Expected Output
Known Workarounds
No response
Additional Information
I have 'hacked' the httpclient.nim code and figured out that changing the code in
requestAux
to perform only ONEawait client.socket.send
instead of two brings back performances to what we can expectSomething like that
now it's ok
So. Not sure where the issue is really, maybe in the async machinery ?
The text was updated successfully, but these errors were encountered: