Skip to main content

Capacity Estimation

Assume:

  1. DAU = 500 M users
  2. MAU = 2 B users

A. Throughput [requests per unit of time]

Throughput can be further divided into write-throughput and read-throughput.

So, Let's start with what all operations user can perform:

  1. Updating Request on ascessing the rate-limiter [Write-Operation]
  2. Ascessing the rate-limiter [Read-Operation]

A.1: Read-Throughput

Assume every user requests for 100 API-calls per day.

Total Read operations per day = DAU * 100 = 500 M * 100 = 50 B read-request per day.

A.2 Write-Throughput

Assume there are 50 UNIQUE API's. Then counters will be stored for each user per api.

Total Write operations per day = DAU * 50 = 500 M * 50 = 25 B write requests per day

B. Storage [Bytes per unit of time]

Assume Average storage as = UserId + API + Counter = 100 bytes, and assuming 50 unique api's.

Average Mapping-Size = 100 b
Total Storage per day = Write-throughput * Average Mapping-Size
= 25 B * 100 b
= 2.5 B Kb
= 2.5 Tb per day

For Estimating storage for 10 years, we need to know, how many unique users will come in the span of 10 years.

C. Cache-Memory

Cache Memory is generally 1% of total storage per day

Cache-Memory = 1% of daily Storage = 0.01 * 2.5 Tb = 25 Gb per day

D. Network Bandwidth

D.1: Ingress Traffic

Traffic coming into the system i.e. write traffic

Assume the request-response data size is 1 Kb.

Ingress = Write per second
= (Total Writing requests per second) * (Average Entry size)
= (25 B / 24/ 60/ 60) * (100 b)
= (289.35 K requests/sec) * (100 b)
= 28.9 Mbps

D.2: Egress Traffic

Traffic going out of the system i.e. read traffic

Egress = read per second
= (Total read requests per second) * (Average request-response Size)
= (50B / 24/ 60/ 60) * (1 Kb)
= (578.7 K/sec) * (1 Kb)
= 578.7 Mbps