When you hear that server is down… server is down… What does ‘Down” mean ?
See.. everything has a limit or capacity e.g. we can drink 5 ltr water at a time, Beyond that it can damage that stomach. Similarly each server has limited CPU speed, memory and internet bandwidth.
So let us understand the concept of client & server. When we open any website (e.g. https://www.HelloRishtey.com) in our browser (e.g. chrome) then the website gets opened.
The browser is ‘client” here and the computer where https://www.HelloRishtey.com is stored is called as “server”.
When we open the website, the server sends us the page and our browsers displays the page. Similarly thousand of users open the same page at the same time. Beyond a certain limit, when simultaneously users open the website, the server stops working because it has limited resources like CPU speed, RAM & internet bandwidth.
We call it server throughput:
It means how many requests a server can handle per unit time. e.g. request handling capacity per (without any error).
So the question is how to calculate it ?
In one of my .NET project, my manager asked me to calculate the server capacity. I started the research. After so many articles I came to some conclusion. Here is the procedure to find the server capacity & we can find server is able to handle how many request per second.
When a page is shown on the browser then along with the html file, (in the background) some other files are also sent to server. So it means when a user opens a page, it fetches the html with those files and displays the page content to the user.
I calculated the approximate data of files being used is here:
Find the total file size of following files:
53 ascx files = 53 275,416 bytes
310 aspx files = 310 4,805,494 bytes
54 css files = 54 834,304 bytes
13 html files = 13 84,545 bytes
67 js files = 1,968,246 bytes
Total 497 files = 7968005 bytes
So total 497 files having size 7968005 bytes
Let us find the average page size: 7968005/497=16032 bytes
There are some other things which consumes bytes…
TCP Connection consumes: 180 bytes
GET Request consumes: 256 bytes
Protocol overhead consumes: 1,364 bytes
So now total file size becomes: 16032+180+256+1364= 17832 bytes
Convert it in to bits. Total Bits=17832 x 8 = 142656 bits.
So it means on average 142656 bits per request will be retrieved by the server.
As per our IT admin, we have 100mbps internet line connected to server.
It means the server can transmit 100 x 1000000=100000000 bits per second
REQUEST PER SECOND= Transmit Capacity/Avg. Page Size
So let us divide = 100000000/142656 = 700
We got the approximate figure of 700. This means the server can handle 700 requests per seconds. Beyond this, the server will go “Down” means server will not be able to handle more than 700 requests.