cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <>
Subject Formula for scaling requirements
Date Thu, 14 Feb 2002 14:58:12 GMT
This is something we may want in our developer's documentation.  These two formulae
(both corroleries of each other) will help in determining #1 the target length of
time for a response time, and #2 given a response time how many requests per period
I can expect to process.

Rt = ( K / Tr ) * P
Tr = ( P / Rt ) * K


Rt = Response time per unit of time (typically seconds)
Tr = Total responses in a given period
K  = Constant representing a period in units of time (typically seconds)
P  = Number of concurrent requests (aka processes/threads)

It is important to note that for the purposes of using these formulae in the real
world that Tr is tied to P.  It is also important to note that Tr is an average

Also note that if K is set to a long period like a day, then you do not account
for usage spikes.  We will see how they work:

I have a news site that sees 50,000,000 hits a day--if I use Cocoon, how fast do
I need my pipelines?  Units of time will be measured in milliseconds, and my web
server uses 100 threads to process all incoming requests.

K = 24 * 60 * 60 * 1000 ms
P = 100

Rt = 172.8 ms

After measuring Cocoon's performance on my hardware, I discover the average response
time with 100 socket handling threads is 1,172.8 ms (10 times the target).  I would
need 10 machines clustered to handle the load.  That is not acceptible.  After
optimizing my pipelines, I get the average response time to 892.3 ms.  How many
requests can I handle in a day assuming all other variables remain the same?

Tr = 9,682,842

Now I only need 5 machines to handle my load!  (granted the actual difference between
the response times is 5.16, but it is an acceptible margin).  This is much better.

Now, let's assume we have 5 machines each with only 20 threads to handle incomming
traffic.  For Cocoon, this is an easy load.  My measured performance on one maching
yields only 50 ms per response.  Now, how many responses can I handle in the same

Tr = 172,800,000

Wow!  That is 3 times my need now!  It is the same 5 machines, but by reducing the
number of threads handling connections I actually increased my ability to handle

Granted, in a real world the response time is different from time spent on the server.
50 ms per response is only the time that Cocoon spends handling the request in this
last example.  You will find that the actual response time (including the time it
takes for the server to recognize the request) with only 20 threads per machine is
significantly longer.  You have to take the measured time from the client's perspective
for the response time measurement.


"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin

To unsubscribe, e-mail:
For additional commands, email:

View raw message