aiortc / aioquic

QUIC and HTTP/3 implementation in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTTP3 upload too slow

BingoZ opened this issue · comments

Hi, I am using aioquic version 0.9.23 to send a 20MB data based on the HTTP3 protocol. However, I found that the speed of sending data using aioquic's send_data function is relatively slow.

Upon packet capture analysis, it was observed that aioquic slices the 20MB data into segments with a maximum body size of 1200, resulting in over 60,000 bidirectional communication packets, which may be the reason for the slow transmission rate. The total time taken is around 7 seconds.

Here are my other attempts:

  1. Using Python requests libaray with HTTP/1 protocol to transmit the same data packet, packet capture revealed that the maximum body length of the sent packets could reach 64,000, resulting in approximately 1200 bidirectional packets, with a total time of around 1.3 seconds.
  2. Attempted to modify the maximum length of the data packets sent by aioquic, i.e., max_datagram_frame_size, but found that this configuration seems to be limited to a maximum of 1500 by PACKET_LENGTH_MAX in crypto.c,raising error with msg "aioquic._crypto.CryptoError: Invalid payload length".

Is there any way to improve the data transmission speed of HTTP3 streams?

Hi,@jlaine would it be kind of you to give any suggestions?

I'm confused by the numbers in your report. Both TCP and QUIC (UDP) will be sending payloads that stay below the IP packet path MTU, which is not typically bigger than 1500 on the Internet, and should have similar numbers of packets. I measured a local HTTP transfer between an aioquic client and an aioquic server on my laptop, and it was less than 19000 packets (most of which were the 20MB payload, and a few hundred of which were acks). It also seemed plenty fast, for python anyway! I suspect there are other factors involved, but there is not enough information in your report to know. In particular, just how are you calling aioquic (besides send_data()).