Urgent.News

What's breaking now, across thousands of outlets.

Tech

"How Many Servers Do We Need?" — Back-of-the-Envelope Estimation for System Design

"How many servers do we need?" sounds like a question that needs a research project to answer. It doesn't — it needs five minutes of napkin math. Back-of-the-envelope estimation is the habit of turning vague requirements ("we'll have a lot of users") into concrete numbers (queries per second, gigabytes of storage, megabits of bandwidth) before you design anything, because every real decision…

Determining the number of servers required for a system design doesn't require a large research project, but rather a quick back-of-the-envelope calculation. The process involves turning vague requirements like "we'll have a lot of users" into concrete numbers such as queries per second, storage, and bandwidth before beginning any design work. This estimation helps in making the right order of magnitude decisions rather than striving for precision.

A worked example is provided: a link-sharing app with 10 million daily active users, where 1% post a link daily. This results in approximately 100 MB of write volume per day, equating to around 1.2 writes per second. Considering the traffic isn't evenly distributed, peak write QPS could be as high as 5. On the other hand, reads are roughly ten times the writes, leading to peak read QPS of around 50. The storage required to hold five years' worth of posts is approximately 180 GB, which fits comfortably on a single database.

A few reference numbers that are beneficial to memorize include the fact that a single application server can handle between a few hundred to a few thousand requests per second. A relational database on solid hardware can manage thousands of simple queries per second. Network round trip times within the same data center range from 0.5-1ms, while those across the country or ocean can take 50-150ms. These figures help in sanity-checking any estimate produced.

The process involves working in the right units and converting only at the end. Traffic is typically easiest to reason about in requests per day, which can then be converted to requests per second by dividing by 86,400. It's also important to remember that real traffic has a peak-to-average ratio of around 2-5x during a system's busiest hour, and any capacity plan built only on the average QPS can fail during the actual peak.

Storage requirements often end up being the deciding factor, especially for features that might seem small per item but add up quickly at scale. Finally, rounding values aggressively helps in arriving at a quicker and directionally correct estimate, rather than spending too much time on precise calculations.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

What Shipping Hebrew RTL Actually Takes: Anatomy of an 11-Language Release

Everybody "supports multiple languages." Almost nobody ships Hebrew. When we closed the v3.131.x line on MeshCtx — an open-core (AGPLv3) memory layer for AI agents — the headline feature wasn't a…

  • Hebrew is the 11th language added to the release, requiring RTL implementation
  • Over 1,400 translation keys and 270 landing page keys need handling
  • 278 i18n-related tests ensure proper RTL behavior

More from Sunday 20 September →