🎓 A1Learner
🔍
0 of 47 lessons completed

Back-of-Envelope Estimation

Back-of-envelope estimation is a quick, rough calculation that sizes a system before a detailed design. Its answer only needs the right scale, not an exact count.

From a day to a second

One division turns the daily count into an average rate. A rough rate like this is already enough to size a system.

daily_requests = 100000000
per_second = round(daily_requests / 86400)
print("Requests per day:", daily_requests)
print("Average requests per second:", per_second)

Working out the peak

The peak comes from the daily count itself. Doubling the rounded average instead creates a small error, and the last line shows it.

daily_requests = 100000000
average = round(daily_requests / 86400)
peak = round(2 * daily_requests / 86400)
print("Average per second:", average)
print("Peak from the daily count:", peak)
print("Doubling the rounded average gives:", 2 * average)

Example

daily_requests = 100000000
seconds_in_day = 86400
average = round(daily_requests / seconds_in_day)
peak = round(2 * daily_requests / seconds_in_day)
print("Step 1 - requests per day:", daily_requests)
print("Step 2 - seconds in a day:", seconds_in_day)
print("Step 3 - average per second:", average)
print("Step 4 - peak per second:", peak)

Key points

  • Given figure: start from a figure stated in the requirements, such as a daily request count.
  • Peak rate: the rate during the busiest period, which sits above the average rate.
  • Step order: do each step in a fixed order, and write down each result before the next step.
  • Worked average: 100,000,000 requests a day averages about 1,157 requests per second.
  • Worked peak: that daily count gives a peak of about 2,315 requests per second at twice the average load.

In this example, each printed line is one step of the chain, from the given daily count to the final peak.

Note

state each step in plain words before trusting the final figure.

Try it Yourself

Edit the code, then press Run.

Running is simulated

Exercise

A system gets 100,000,000 requests a day, and peak load is twice the average load. About what is the peak rate?