Topic: How to calculate effective serving capacity of a server
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.
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