Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum HTTP Packet Size

What is the maximum size of HTTP packets? I am interested in the size of the response to an HTTP GET request (Not this! This question is about the request size). Is there a size at all? If I download a 1GiB file, does that end up as just 1 HTTP GET request? (Intuitively, I do not think this happens - Also, partial downloads / multi threaded downloaders would not work).

I know that there is a maximum length of an IP packet and TCP packets that are longer than that are fragmented across multiple IP packets. Does such a thing happen with HTTP as well? The reason I am looking for an answer to this question is to figure out the AWS S3 billing scheme which charges 1c / 10K get requests. So how many GET requests are begin served for 1GiB.

like image 785
Lord Loh. Avatar asked Nov 04 '22 13:11

Lord Loh.


1 Answers

I got an answer on AWS S3 Forum by Seungyoung Kim

If you download the 5GiB file using GET request. S3's billing system will count it as 1 GET request and 5GiB data transfer. FYI, if you stop downloading file at 2GiB out of 5GiB, then they will count only 2GiB data transfer.

GET request is not fragmented normally unless you split up the call into several consecutive GET range calls.

So, if you issue 5 individual GET requests using range header for each 1GiB data block, they will count it as 5 GET request but still same 5GiB(1GiB x 5 times) data transfer. Technically little more than 5GiB due to additional HTTP protocol headers.

If this is right, there is no packet fragmentation of HTTP GET Response (although they come across several TCP packets and a lost TCP packet is handled by TCP and does not illicit another GET request to resume)

like image 109
Lord Loh. Avatar answered Nov 11 '22 05:11

Lord Loh.