-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
HTTP/3 file uploads is significantly slower comparing to HTTP/2 or an in house HTTP/3 client #14198
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
Labels
Comments
Stefan did a talk about performance in curl at curl://up 2024 that you might find interesting: https://www.youtube.com/watch?v=4eBAzi7D_WM
|
@alexsn nice find. You are probably right with your analysis that the flow window is only restarted once everything is acked. I'll have a look at how we can make this more "flowing". |
Added scorecard upload tests in #14208. These show the abysmal performance on HTTP/3 PUTs. |
alexsn
pushed a commit
to alexsn/curl
that referenced
this issue
Jul 18, 2024
Currently we're waiting for sendbuf_len_in_flight to hit zero before resuming upload which means we're blocking and waiting for _all_ acks to arrive before sending more data. This causes significant delays especially when ack delay is used on the server side. The fix addresses several issues in h3 over ngtcp2: - On ack we now call nghttp3_conn_resume_stream() when we have more data to send. - upload_left was incorrectly computed on CF_CTRL_DATA_DONE_SEND as we need to subtract the ammount of data we have in flight. - Remove upload_blocked_len as we Curl_bufq_write call will do the right thing when called from cf_ngtcp2_send. Closes curl#14198
meslubi2021
pushed a commit
to Unity-Curl/curl
that referenced
this issue
Jul 19, 2024
Currently we're waiting for sendbuf_len_in_flight to hit zero before resuming upload which means we're blocking and waiting for _all_ acks to arrive before sending more data. This causes significant delays especially when ack delay is used on the server side. The fix addresses several issues in h3 over ngtcp2: - On ack we now call nghttp3_conn_resume_stream() when we have more data to send. - upload_left was incorrectly computed on CF_CTRL_DATA_DONE_SEND as we need to subtract the ammount of data we have in flight. - Remove upload_blocked_len as we Curl_bufq_write call will do the right thing when called from cf_ngtcp2_send. Fixes curl#14198 Closes curl#14209
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I did this
I'm settings to a http3 transfer by using CURLOPT_HTTP_VERSION and capturing request stats, as can be seen below the H3 request send takes a lot longer to complete.
I expected the following
I expect the file upload using H3 to be at least as fast as H2, currently it's about 3 - 4 times slower:
Request stats
Analysis:
I've taken packet capture from libcurl transfer and it looks like libcurl sends 64k of data then blocks until it all frames are acked which suspends the upload for about 40ms-50ms on every 64k chunk

When comparing this to a in house HTTP/3 client there are no hangs and the upload continues smoothly throughout the transfer

Checking curl_ngtcp2.c it looks like there's a buffering issue where the obvious suspect is
sendbuf_len_in_flight
which is where the 64k part comes from and there are multiple locations waiting for this value to drop to zero (like here and here) before resuming.I've tried setting CURLOPT_UPLOAD_BUFFERSIZE to a larger value (512kb) which does help (makes it about 2x faster) though it's still about 2x slower then H2.
curl/libcurl version
libcurl 8.8.0 with wolfssl / ngtcp2 / nghttp3 and nghttp2.
operating system
Linux 5.12.0-0 #1 SMP Mon Jun 26 17:52:47 PDT 2023 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: