Last six months have been great for me when I was exposed to the great world of scalability of my product. I will try to summarize some of my findings regarding scalability and then may take some of those stuff in detail in coming days/weeks/months.
- Before we start anything related to scalability for the website measure the performance of the pages with a single user on a idle bandwidth above 500 KB/s.
- To measure the response time of pages do the following
- Install tool like HTTPWatch on your machine. The basic version is free and available on http://www.httpwatch.com.
- Set the expiry content on the virtual directory to large number of days i.e. 3 or 5 or 10 (this can changed based on your particular need).
- Set the Application Pool(IIS 6.0) property such shutdown worker process if idle for 20 minutes and restart after 1740 minutes. (Switch off this setting).
- Now traverse through the selected interactions that you would like to measure once. This will warm up the browser cache.
- Now measure the response time using the HTTPWatch.
- If the response time of the page are below 3 seconds then it is right case for scalability otherwise first tune the pages to bring the response time below 3 seconds.
- One of the first thing that you should target to improve the scalability is to start with the database layer.
- Check how many queries are getting fired per interaction.
- Is there any redundant data being fetched.
- If yes then can we cache the data to lesser down database resource usage.
- Can we differentiate between Read and Write operations on database.
- If yes then can we have separate connection string for both of them.
- This is useful if you want to have separate database for Read and Write. (Synchronization can be an issue, will propose my proposal in later posts).
- Moving to the website having aspx pages,
- Are you using Session variables?
- If yes then use ASP.NET State Service for storing the session variables.
- Do you store the data in files?
- If yes then can they be stored on shared location.
- Do you generate content dynamic?
- If yes then can they move to shared location.
- Now use the VS 2005 Load Test tool to identify the bottleneck for number of users at which the website starts breaking or deteriorating.
- Use Windows 2003 Server Network Load Balancing (NLB) component to load balanced your website. Its simple to configure and leverage.
- Now again use the VS 2005 to load test tool to measure now at what point the website starts deteriorating.
One of the reason of slow response time is the way we have written the ASPX pages. In my coming post I will share my experience.
Filed under: .NET Framework, ASP.NET, C#, Laod Balancing, Load Balancing, Others, Scalability | Tagged: .NET, .NET 2.0, .NET Framework, ASP.NET, ASP.NET 2.0. ASP.NET Performance, Performance, Scalability | Leave a comment »