Tuesday, August 31, 2010

CAPACITY PLANNING

I will try to explain capacity planning by doing a very basic capacity planning for a sample e-Commerce application. I will try to calculate the number of servers required for my site.
Let me take a scenario of my web site which has some 100,000 user visitng daily. Now to do capacity planning for this site, I refer to this site of Capacity Planning Guide http://publib.boulder.ibm.com/tividd/td/ITAME/GC32-0847-00/en_US/HTML/cpmst17.htm#HDRCPD001997094

Based on refered Capacity planning guide, the steps of capacity planning are:
1. Identify Server Transactions
2. Define transaction throughput requirements
3. Choose Hardware
4. Gather transaction throughput requirements
5. Calculate the number of the machines

1. Identify Server Transactions
My e-Commerce applications common use-cases with percentage in transactions are:

Use-Cases     percentage
------------------------
1. Search         50
2. Register       15
3. Login          20
4. Add to Basket  10
5. Purchase        5

2. Define transaction throughput requirements
By popular assumption 1% of users are concurrent = 100,000 x 1% = 1000 users.

Now all 1000 concurrent users are not working on same pages or doing same kind of transactions. I take a sample of the significant use-cases. I divide the users among the use-case transactions based on some percentages.

I take my e-Commerce applications common use-cases and caculate the transaction throughput requirements:

Use Case     %Users #Users   TT*  TPS** Txn-Type   Req. MCycles
-----------------------------------------------------------------
Search          50    500    10   45     Heavy        9000
Register        15    150    30    5     Medium        450
Login           20    200     5   33     Light        1320
Add to Basket   10    100    10    9     Medium        810
Purchase         5     50    20    3     Heavy         600
------------------------------------------------------------
               100    1000                          12180
------------------------------------------------------------
TT  - Think time
TPS - Transaction per second
TPS = ConcurrentUsers/(1+ TT)3. Choose Hardware
Now, based on my selected App Server H/W configuration,
Util   CPU Specs              Capacity of Server
--------------------------   --------------
50%   Single Quad Core-3GHz   6000 MCycles (2x4x3000x50% MHz)


4. Gather transaction throughput requirements
Based on my applications testing,

Txn-Type   App M-Cycle
--------------------------------------
Light        40
Medium       90
Heavy       200

5. Calculate the number of the machines

Now, based on my selected App Server H/W configuration,

Util.     CPU Specs
--------------------------       --------------
50%     Single Quad Core-3GHz    6000 MCycles (2x4x3000x50% MHz)
          Reqd. Txns             12180
          Reqd. Servers           3

So, I arrive at the 3 servers of single Quad Code-3GHz specification to meet this demand.

No comments:

Post a Comment