← Lessons

quiz vs the machine

Gold1360

System Design

Upload and Download Throttling

Shape per client transfer rates so one tenant cannot starve the shared pipe.

4 min read · core · beat Gold to climb

Why throttle bytes

Rate limiting requests is not enough for file storage, because one slow upload of a huge file can monopolize bandwidth even at one request per second. Throttling shapes the byte rate of transfers so the shared network is fairly divided.

Mechanisms

  • A token bucket per client fills at the allowed bytes per second; a transfer spends tokens as it moves data and stalls when the bucket empties.
  • Per connection caps bound any single stream so no one transfer dominates.
  • Fair queuing interleaves chunks from many tenants so a giant file does not block small ones.

Pushing back gracefully

When a client exceeds its budget the server can slow the stream rather than fail it, or return a retry signal. Smooth backpressure beats hard rejection for large transfers, since restarting a multi gigabyte upload is expensive.

Key idea

Throttling shapes per client byte rates with token buckets and fair queuing, and prefers slowing a stream over failing it so large transfers survive.

Check yourself

Answer to earn rating on the learn ladder.

1. Why is request rate limiting alone insufficient for file storage?

2. What is the preferred response when a client exceeds its byte budget?