# How Many Servers? — Cost & Capacity Estimation

Source: https://www.skillbyai.com/en/capacity-estimation/ce-server-count

> Compute server counts from peak QPS, per-server throughput, utilisation targets and redundancy.

## The server-count formula

A first-pass server count is **peak QPS / (per-server QPS x target utilisation)**, rounded up, plus redundancy. Per-server QPS comes from a benchmark or from per-request CPU cost (cores x 1,000 / CPU ms per request). **Target utilisation** is deliberately below 100%, often somewhere around 50 to 70% for latency-sensitive services, because latency rises sharply as a server nears saturation and because you need room for spikes and deploys. **Redundancy** covers failure: with N+1 you can lose one server and still carry peak, and across availability zones you may plan so that losing an entire zone still leaves enough capacity. Repeat the calculation for each tier separately (web, application, cache, database), since each has its own per-node limit, and the tier with the worst ratio is the one to redesign.

## Server count with zone redundancy

Plan so that losing one of three zones still serves peak traffic.

```python
import math

peak_qps = 24_000
per_server_qps = 1_500
target_util = 0.6
zones = 3

needed = math.ceil(peak_qps / (per_server_qps * target_util))
# survive the loss of one zone: the remaining zones must carry everything
per_zone = math.ceil(needed / (zones - 1))
total = per_zone * zones
print(f"servers for peak       : {needed}")
print(f"per zone (N-1 zones ok): {per_zone}")
print(f"total provisioned      : {total}")
```

Output:

```
servers for peak       : 27
per zone (N-1 zones ok): 14
total provisioned      : 42
```

## Redundancy is a multiplier, not +1

With three zones, surviving one zone loss means each zone needs half the total load, so you provision 1.5x the bare minimum. Interviewers like it when you state this explicitly.

**Quiz:** Peak is 9,000 QPS, each server handles 1,000 QPS, and the target utilisation is 50%. Ignoring redundancy, how many servers are needed?

- [ ] 9
- [ ] 4.5
- [ ] 12
- [x] 18

*Answer:* 18. Each server is planned to carry 1,000 x 0.5 = 500 QPS, and 9,000 / 500 = 18 servers.
