Topic: How to calculate effective serving capacity of a server

Hello everyone,

I am looking forward to understand that how do I calculate the effective serving capacity of my EC2 server - and hence, how to scale up.

The project is a browser plugin which triggers on each page a user is visiting via his browser.

I have one Small EC2 instance running OpenX, 1 Rails project, 1 Rails metal project and a MySQL db (all on the same instance, via different subdomain names)

Assumptions - If the app has 300 users and each user visits 30 websites/day.

  • Static Javascript serving (being hit 30*300 times per day, browser caching (per day) in place, hence 300 effective requests/day)

  • Rails middleware on each website viewed (being hit 30*300=9000 times per day with average 300ms response time)

  • Rails project being hit 1000 times a day, again with 300ms response time

  • OpenX server being hit twice on each website viewed (2*30*300=18000 times per day with avg response time of 300ms)

Calculation via Requests / day
300 + 9000 + 1000 + 18000 ~= 30,000 req/day
If this generates a load of 30% on my EC2 instance (noticed from EC2 server monitoring), would it be correct to say that my server can support 3 times this load - or nearly 1000 such users per day.


Calculation via CPU burn
30,000 req per day = 300*30,000 ms CPU load per day = 9,000,000 ms of CPU load per day = 9000 sec of CPU load per day
1 day = 86400 secs
CPU load capacity = 86400/9000 = ~= 9 times.
Hence, I can support nearly 2700 users per day (300*9).


One of these figures is wrong... or I'm not calculating them correctly.

Any help would be great smile


Thanks,
Mayank

-------------------------
http://adomado.com

Re: How to calculate effective serving capacity of a server

I'm considering the MySQL load within the 300ms response time.

-------------------------
http://adomado.com

Re: How to calculate effective serving capacity of a server

I think you are ignoring the fact that processes interfere with each other.  I would suggest you attempt to measure response time with increasing load.  At some time, probably long before the system is 100% busy you will find the response time goes above your desired time.  You also need to be aware that arrivals are not evenly distributed over the day.  You need to design the system to deliver the desired response time with some expected surity.  You will never be able to guarentee the desired response time 100% of the time because you can not (I assume) control the users so that 100 of them (or 1000 of them) will not initiate a request at the same time.