Clarity, Technology, and Solving Problems | PracticeThis.com
WP7 App with Key Windows Azure resources – Slides, Videos, How-To’s, and T-shooting – for quick consumption on the go.
Chatty database access is the surefire way for slow performance caused by resources starvation that might even lead to denial of service. Following is a real world case.
Service Unavailable message is consistently observed when there are more than 150 users access the web site. We think IIS cannot handle more than 150 users. What would you suggest?
Let's see what "Service Unavailable" means. "IIS cannot start any new worker processes because of limited system resources...". Let's see the code.
The code was calling on DB Access function that was put inside for loop that was called inside event handler. The event handler was called on each GridVew's row creation. Meaning, DB access in nested loop. In case of small GridVew of 10 rows and 10 cells the database would be accessed 100 times for each request. 150 concurrent users would create significant load of 15,000 connections:
After running SQL Server profiler it became clear that database access should be significantly improved. Following is the number of SQL Commands performed as a result of single request:
For improved performance avoid chatty data base access. Apply caching techniques instead.
If you use SQL Server 2005 Express which does not come with built-in profiler you might find useful the following free tool:
Profiler for Microsoft SQL Server 2005 Express Edition
These free performance tools will save you time and money identifying performance bottlenecks. Your customers will thank you for building fast and responsive applications.
Download the tool here.
Analyzer gives insight into everything from server load and customer usage to intranet analysis. It allows you to gain vital feedback on visitor behaviour and preferences, so you can more accurately customize your site to meet the needs of your clients
After you download and install the tool - run it. Just drag and drop log files onto it and then click on View icon:
You will be presented with nice array of summary and detailed reports:
There are few scenarios I can see this tool would be very useful:
This is a digest of WCF Security resources I was collecting for some time. Drop me a comment in case it is useful.