How can I do a capacity planning of my web application and decide the deployment architecture?

Amar picture Amar · Jan 20, 2011 · Viewed 13.9k times · Source

I have an ASP.net web application deployed on the small AWS instance (Dual Core AMD, 2.60 GHz, 1.7 GB RAM). I would like to perform load testing on this server for 300 concurrent users and for future, I want to design the tentative capacity planning and deployment architecture for 250,000 registered users for my application.

I am very new person in this area and have not done any kind of load testing before.

The Use-case and scenario of my application will be as below:

Scenario - 250, 000 registered users in database

Concurrency – 5% - 7% - approximately 17,500

Each user has a book shelf and assuming each user is subscribed for 10 books. Each book is of around 25 MB in size with 400 pages

Use cases

  1. User Login

    • Database authentication & authorization
  2. View Book Shelf with book images

    • Book Shelf (.swf) - 400 KB (gets loaded for each user)

    • 10 book images will be loaded (20KB per image)(approximately)

    • catalog.xml - 30 KB / user for allocated for the user

    • Note: Approximately 650KB of data is gets downloaded on to client machine

  3. Browse book : On clicking a book image following files & its sizes will be downloaded to clients machine

    • One time
    • Reader.swf - 950 KB (first download)
    • XML data’s of approximately 100 KB / per book (on click)
      • Book.xml
      • Annotation.xml
      • Catalog.xml
      • Usersettings.xml 40KB*4 = 160 KB per user (.swf)
    • Note: Approximately 1200KB of data is gets downloaded on to client machine

Could someone please suggest how can I proceed with this?

Very much thanks in advance, Amar

Answer

CMerrill picture CMerrill · Jan 24, 2011

Completing the first goal (test 300 users) is pretty straightforward - choose a load testing tool, build the scenarios and test. Then tune/optimize and repeat.

But I think your bigger question is how to approach testing and planning for your full capacity - which you say is ~18k concurrent users. First, make sure that number (7% of user base) is the peak concurrency, not average. You need to test the peak.

So assuming that you are planning a load-balanced multiple-server cluster to handle that load, the next step is to determine the maximum capacity of a single web/app server, without the load-balancer in place. This gives you a baseline that you can use to judge the performance of the cluster. This is a really important step and many of our clients skip this step, to their own detriment. It is important because there are many conditions under which a load-balanced system does not scale linearly with the number of servers in the cluster. Ideally it should and good systems get pretty close. You'd be surprised how frequently we see systems that don't scale well at all. We've even seen a few systems that actually have lower capacity as a cluster than a single server could handle on its own.

Once you have that baseline established, you can make a preliminary estimate about the total number of servers you'll need and you can build your cluster. I recommend next testing with 2 web/app servers. This should nearly double your capacity. If it doesn't then you need to determine why before moving on to larger tests. Likely candidates are the load balancer setup or the database (if a single database server is servicing all the web/app servers). Occasionally something more fundamental to the application architecture is at play.

When you are satisfied that scaling from 1 to 2 servers is performing optimally, then you can proceed to scale up to your full cluster and test maximum capacity. Be prepared to back-track if you don't see the scalability you expected - test with 3, 4, 5 servers, etc.

I hope that helps! Good luck :>