Skip to content

Bandwidth: link speed and monthly transfer

The traffic estimate gives a rate of requests. Bandwidth turns it into bytes, and it answers two different questions.

  1. How fast must the link be at the peak? L = R × p × 8, where R is the peak requests per second, p is the average payload in bytes, and 8 is the number of bits in a byte.
  2. How much data does a month move? M = A × p × n × d, where A is the average requests per second, n is the 30 days of a month and d is the 86,400 seconds of a day.

Link speeds are quoted in bits per second and sizes in bytes. A byte is 8 bits, and a megabit per second is 1,000,000 bits per second, so 1 Mbit/s is 0.125 MB per second. Mixing the two up is an error of a factor of 8.

Mental model. A link has to carry the peak, so it is sized in bits per second at the peak. A month’s transfer, and the bill that follows from it, is a total in bytes, so it is built from the average.

Count the bytes in the direction you are sizing. For a shop, the responses leave and the requests are small, so the payload is the average response. The direction matters for the link, and it matters for the bill: the AWS architecture blog says that inbound data transfer is not charged across its services, while data transferred out to the internet is charged per service and region. Other providers have their own price lists.

The shop’s peak is 1,852 requests per second, from the first lesson. Suppose its average response is 50 kB, a round number for illustration that you would replace with a measurement of your own. The calculator starts there, with a ratio of 4. Its fields are Peak requests per second, Payload per request and Peak-to-average ratio.

Bandwidth calculator

Your numbers

requests per second

The busiest moment, because the link has to carry it. The traffic calculator gives it.

kB

The average number of bytes one request moves in the direction you are sizing: usually the response, for data that leaves.

×

Used for the monthly transfer: a month moves what the average rate moves, not the peak held for a month.

Changing the numbers needs JavaScript. The result is for the starting numbers.

Result

Link speed needed at the peak741 Mbps

Over a month, the average rate moves 60 TB.

How it is calculated

Each step shows its formula, the numbers that go in, and the figure that comes out.

  1. Link speed at the peak

    L = R × p × w

    The bytes per second at the peak, times 8 bits per byte. Link speeds are quoted in bits.

    R peak requests per second
    1.85K
    p payload per request
    50 kB
    w bits in a byte
    8

    L link speed at the peak741 Mbps

  2. Average requests per second

    A = R ÷ f

    The peak divided by the peak-to-average ratio.

    R peak requests per second
    1.85K
    f peak-to-average ratio
    4

    A average requests per second463

  3. Data moved in a month

    M = A × p × n × d

    The average rate, times the payload, times the seconds in a month: n days of d seconds. In back-of-envelope mode a day is taken as 100 000 seconds.

    A average requests per second
    463
    p payload per request
    50 kB
    n days in a month
    30
    d seconds in a day
    86.4K

    M data moved in a month60 TB

What each payload size costs, with your other numbers
Payload per requestLink speed at the peakMoved in a month
1 kB14.8 Mbps1.2 TB
10 kB148 Mbps12 TB
50 kB · your payload741 Mbps60 TB
100 kB1.48 Gbps120 TB
1 MB14.8 Gbps1.2 PB
10 MB148 Gbps12 PB
Model notes

Assumptions

  • Every request moves the same average payload, in one direction. Real payloads vary, and the traffic in the other direction is not counted.
  • A month moves what the average rate moves: the peak rate divided by the ratio you enter. If the real ratio is different, the monthly figure is off by the same factor.

Simplifications

  • Only the payload is counted. Protocol headers and encryption add bytes on the wire, and compression removes some, so the link carries a different amount than this figure.
  • Sizes use decimal units and link speeds are in bits: 1 Mbps is 10^6 bits per second, and a byte is 8 bits, so 1 MB per second needs 8 Mbps.
  • A day has 86 400 seconds. In back-of-envelope mode it is taken as 10^5 seconds, the nearest power of ten, so the averages come out about 14% lower than the exact ones.
  • In back-of-envelope mode, the counts and sizes you enter are rounded to the nearest power of ten before anything is calculated. The result is an order of magnitude, not a figure to buy against.

Parameter values are illustrative. They are not benchmarks of any real product.

Follow the steps. 1,852 requests of 50,000 bytes are 92,600,000 bytes per second, which is 92.6 MB per second, and × 8 bits makes 741 Mbps. A link of 1 gigabit per second carries 125 MB per second, as the performance module worked out (CPU, memory and I/O), so the shop would use 74% of it at the peak. That leaves little room for a spike, and the performance module showed what happens to latency as a resource fills.

The second figure is the month. The average rate is 1,852 ÷ 4 = 463 requests per second, and 463 × 50 kB × 30 days × 86,400 seconds is 60 TB a month. A month moves what the average rate moves. Using the peak for the whole month would give 1,852 × 50 kB × 2,592,000 seconds = 240 TB, four times too much, because the busiest moment lasts only part of the day, not the whole month. The factor is the peak-to-average ratio itself.

The table under the steps compares payload sizes with your other numbers. Ten times the payload is ten times the link and ten times the transfer: at 1 kB the peak link would be 14.8 Mbps, and at 1 MB it would be 14.8 Gbps.

The two conversions to practise are bytes to bits and peak to month. Here are three short questions.

Bandwidth: check your understanding

This quiz needs JavaScript to check your answers.

Question 1 of 3

A network link is rated at 100 Mbps, which is 100 megabits per second.

At most how many megabytes can it carry in one second?

Enter a number and choose its unit.

Question 2 of 3

A service peaks at 2,000 requests per second. Each response is 100 kB, and the requests themselves are small enough to ignore.

What link speed does it need at the peak?

Enter a number and choose its unit.

Question 3 of 3

A service peaks at 4,000 requests per second, and its average is a quarter of the peak. Each response is 20 kB.

Which rate gives the data that leaves in a month?

Choose one answer.

What happens if the payload grows tenfold?

Section titled “What happens if the payload grows tenfold?”

Suppose the shop starts to send larger images, and the average response goes from 50 kB to 500 kB. Change Payload per request to 500.

The peak link becomes 7.41 Gbps. It no longer fits a 1 Gbps link, and it would use 74% of a 10 Gbps one. The month moves 600 TB. The number of requests did not change and the processors may be nearly idle. The link is the limit, as the performance module found for network capacity.

What helps is to send fewer bytes, by compressing or resizing, or to serve them from closer. Suppose an edge cache answers 90% of the requests, which is a hit ratio of 90%, as in CDNs, edge caching and anycast. The origin then sends only the 10% that miss: 0.1 × 7.41 Gbps = 741 Mbps, the same as before the payload grew. The traffic has not vanished. The edge’s network carries the rest. What shrinks is the origin’s link, and the origin’s outbound transfer with it.

  • Bandwidth answers two questions: the link speed at the peak, L = R × p × 8, and the data a month moves, M = A × p × n × d.
  • A byte is 8 bits. A link of 1 Gbps carries 125 MB per second, and 1 Mbit/s is 0.125 MB per second.
  • For the shop, 1,852 requests per second of 50 kB need 741 Mbps, which is 74% of a 1 Gbps link, and a month at the average of 463 per second moves 60 TB.
  • Holding the peak for a month would give 240 TB, four times too much: the link uses the peak and the monthly total uses the average.
  • A tenfold payload is a tenfold link and a tenfold transfer: 7.41 Gbps and 600 TB. An edge cache with a hit ratio of 90% leaves 10% of it on the origin’s link, 741 Mbps again.

Next: estimating by powers of ten, and what rounding costs.

Your progress

Built by GhaziAlibi.

© ShardCraft. All rights reserved.