educative.io

Number of servers calculation

Can you explain why the number of servers is calculated by dividing the number of users over the server’s req/seconds?

If a server can handle 500 req/sec, then it could handle 500 * 86400 = 43.2M requests per day. Assuming the traffic generated by 5 million users that make 20 requests per day each is evenly distributed over 24 hours, we will have 5 M * 20 = 100Ms request per day. So 100M / 43.2 M => we need 3 servers only.

Thanks,

2 Likes

Hi Reza_Asadollahi,

Take some time to read the " Back-of-the-envelope Calculations( 2 Lessons)" of the same course to understand why the number of servers is calculated by dividing the number of users over the server’s req/seconds. As it is not possible to use only three servers globally.

I hope this will help you. If you still have any queries feel free to ask.
Thanks.

@Amna_Arshad , Maybe you should read the “Back-of-the-envelope Calculations” lesson again? There’s no mention of why the number of servers is calculated by dividing the number of users over the server’s req/seconds.

Any reason why we can’t just use 3 servers globally? Just saying so ain’t going to fly. 3 server’s . I think OP’s calculations are realistic and they actually make sense. All, we are talking is the ability to just serve a simple request. Things’ definitely change when there’ some processing going on… In those cases, a single server definitely can’t serve 500 rps. So, either choose the right rps a server can handle and calculate correctly or just use a random rps and then calculate the number of servers and end up with weird(3 server in this case) values. Please just don’t say “You can’t use 3 servers to serve globally” without giving proper explanation!

Edit 1: You should really check the cost of 7500 server’s with 32cores,256GB ram. follwing is the estimate per month for just processing servers. And we also will have ton of other things like DB, cache, LB etc etc


Course: https://www.educative.io/collection/10370001/4941429335392256
Lesson: https://www.educative.io/collection/page/10370001/4941429335392256/4552284171665408


Course: https://www.educative.io/collection/10370001/4941429335392256
Lesson: https://www.educative.io/collection/page/10370001/4941429335392256/4552284171665408

This type of server calculation has been mentioned in several courses in this module and the logic doesn’t seem convincing. There are a few points that I would like to mention here:

  1. We are in the requirements gathering phase. How do we know the throughput of a server that we haven’t designed yet? We don’t know what our servers need to do, and what kind of servers we need, so it doesn’t make sense to know our server’s throughput in requests per second at this point.

  2. The design includes several different servers, databases, caching systems, load balancers, etc. Which server this refers too at the end? You should map it to one of the servers in the detail design.

  3. The calculation that divides total active users over server’s throughput would give you the number of servers needed if all active users send a request within the same second and we don’t want those users observe any extra latency in this extreme case. So the it gives you the maximum number of servers that you need (7500 servers), and the minimum servers required is 3, based on the calculation in the earlier post. So in reality you aren’t going to run 7500 servers just for that extreme situation, because it will be very costly and servers remain heavily under utilized for the most part of their life.

In my opinion this section has to revised in all courses.

3 Likes

Hi Reza,

We have revamped the “Back-of-the-envelope calculations” throughout the course. Please give it a read for a better understanding of the topic.

Thank you & regards,