AlgoViz

How Large Uploads Work

easy 38 min

A large file goes up in small numbered pieces.

Numbers that decide

Work out a number when the answer changes what you build.

Work it out

Numbers worth having ready

QuestionAnswer
400 MB in 4 MB pieces100 pieces, 102 requests with start and finish
Time at 8 Mbit/s400 s, 4 s per piece
Break at 72%, one request288 MB or 288 s lost
Break at 72%, piecesAt most 4 MB or 4 s sent again
Waiting at 0.1 s per reply10 s in all, 2.5%
1,000 uploads, streamed through 64 KB64 MB of buffers

Requests per second for one million videos a day

1,000,000×10286,400≈1,181/s→×33,542/s\frac{1{,}000{,}000 \times 102}{86{,}400} \approx 1{,}181/\text{s} \xrightarrow{\times 3} 3{,}542/\text{s}
Assumptions: every video is like ours, peak is 3x average. The bytes are 1,000,000 x 400 MB / 86,400 s, about 4.6 GB per second on average. That number, not the requests, argues for sending straight to storage.