educative.io

Server requirements

For the server requirement estimation we usually follow the back-of-the-envelope calculation and assume that the number of DAU = #RPS:

The only difference between Instagram and the back-of-the-envelope example is that the average RPS that a server can handle is 100 (not 8000).

So why is the answer not 50M / 100?

Thanks

1 Like

I agree and it is not uniform across chapters! However, from an interview perspective: they want to see if you have thought about this. Also that a server can handle only 100 RPS seems a bit low to me.

So my thought process has been this:
One thing to note is that IG server predominantly deals with videos and photos which will take a lot of time to process. So the server may only handle say 1000 RPS

500 M DAU/1000 RPS = 500K servers high level. But thats too high (upper bound)

You can go deep to see if you don’t have to cater to all 500M in one go
RPS = 500M users X 20 requests per day/(24 X 60 X 60) = 115740 RPS
If request is distributed uniformly then:
no. of servers needed = (115740) RPS/1000 RPS per second = 115 servers (lower bound)

In reality, request are not uniform lets say we need to cater to at least 10% of DAU at any given point of time
500K servers X 10% = 50K servers (more realistic)


Course: Grokking Modern System Design Interview for Engineers & Managers - Learn Interactively
Lesson: Requirements of Instagram’s Design


Course: Grokking Modern System Design Interview for Engineers & Managers - Learn Interactively
Lesson: Requirements of Instagram’s Design

Hi Mel.

The number 8000 RPS is calculated through some rough estimation provided in the Examples of Resource Estimation. Depending on the server and the query the RPS of the server can be anywhere between 100 and 400k. The main aim of the lesson is to make sure the learner understands the concept as the numbers can vary in different scenarios. Please feel free to reach out to us if you have any more queries.

Thank you