Page 287 - DCAP312_WEB_TECHNOLOGIES_II
P. 287
Unit 14: Debugging and Optimization
Throughput Notes
The number of requests a Web application can serve per unit of time often measured in requests
per second. Throughput can vary, depending on the load (number of client threads) applied
to the server. This is usually considered the most important performance metric to optimize.
To write applications that perform well, it is important to maintain a balance of these metrics.
No single measurement can characterize how our application will behave under varying
circumstances, but several measurements taken together can show how well our application is
performing. For more information about taking measurements of this kind, as well as information
about the performance counters provided with ASP.NET.
ASP.NET has many secrets, which when revealed can give us big performance and scalability
boost. For instance, there are secret bottlenecks in Membership and Profile provider which can be
solved easily to make authentication and authorization faster. Furthermore, ASP.NET 3.5 HTTP
pipeline can be tweaked to avoid executing unnecessary code that gets hit on each and every
request. Not only that, ASP.NET Worker Process can be pushed to its limit to squeeze out every
drop of performance out of it. Page fragment output caching on the browser (not on the server)
can save significant amount of download time on repeated visits. On demand UI loading can
give our site a fast and smooth feeling. Finally, Content Delivery Networks (CDN) and proper
use of HTTP Cache headers can make our website screaming fast when implemented properly.
The following techniques are:
• ASP.NET pipeline optimization
• ASP.NET process configuration optimization
• Things we must do for ASP.NET before going live
• Content Delivery Network
• Caching AJAX calls on browser
• Making best use of Browser Cache
• On demand progressive UI loading for fast smooth experience
• Optimize ASP.NET Profile provider
• How to query ASP.NET Membership tables without bringing down the site
• Prevent Denial of Service (DOS) attack
The above techniques can be implemented on any ASP.NET website, especially those who use
ASP.NET Membership and Profile provider.
14.3.2 ASP.NET Pipeline Optimization
There is several ASP.NET default Http Modules which sit in the request pipeline and intercept
each and every request. For example, SessionStateModule intercepts each request, parses the
session cookie and then loads the proper session in the Http Context. Not all of these modules
are always necessary. For example, if we are not using Membership and Profile provider, we
do not need FormsAuthentication module. If we are not using Windows Authentication for our
users, we do not need WindowsAuthentication. These modules are just sitting in the pipeline,
executing some unnecessary code for each and every request.
The default modules are defined in machine.config file (located in the$WINDOWS$\Microsoft.
NET\Framework\$VERSION$\CONFIG directory).
<httpModules> <add name= “OutputCache” type= “System.Web.
LOVELY PROFESSIONAL UNIVERSITY 281