Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


July 2002

Optimizing ASP.NET Applications for IIS

RSS
Subscribe to Windows Web Solutions | See More Active Server Pages (ASP) Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Download the Code Here

Develop dynamic Web pages that leave ASP in the dust

In two previous articles, I covered the fundamentals of the Microsoft .NET Framework and ASP.NET as they relate to the IIS administrator. The first article, "Get Ready for .NET," May 2002, InstantDoc ID 24479, provides an introduction to the .NET Framework. I explain where you can obtain the .NET Framework and outline the client and server installation requirements. I also explain the .NET Framework's two major components: the Common Language Runtime (CLR) and the .NET Framework class library.

The second article, "ASP.NET Security," June 2002, InstantDoc ID 24838, digs deep into the inner workings of ASP.NET as they relate to designing, configuring, and implementing ASP.NET's security architecture. I introduce ASP.NET's security features, describe the relationship between ASP.NET and IIS, and explain how to use two components—machine.config and web.config—to configure ASP.NET security.

Now that you have an understanding of how ASP.NET and IIS work together, you can begin to optimize ASP.NET performance for IIS. Specifically, you can take advantage of ASP.NET's performance and use ASP.NET caching to create high-performance IIS applications.

A Faster ASP
In case you haven't heard, ASP.NET is fast—really fast—especially when you compare it with Active Server Pages (ASP). At the time of this writing, no independent testing figures were available to gauge ASP.NET's performance against ASP and other platforms. However, initial reports from within Microsoft indicate that ASP.NET on IIS 6.0 on Windows .NET Server (Win.NET Server) straight out of the box, without any special configuration, will run a minimum of 75 percent faster than ASP on IIS 5.0. The handful of ASP.NET applications I've worked with have been a joy from a performance perspective.

ASP.NET code is faster than ASP code, in large part because the former is compiled rather than interpreted. Compiling ASP.NET code permits early binding, strong typing, and just-in-time (JIT) conversion of the processing server's native code. Also, ASP.NET takes advantage of .NET Framework and CLR enhancements such as caching.

When a user requests an ASP page, ASP interprets the page code for each request in the order that the page code appears on the page (i.e., top to bottom). However, the first time someone requests an ASP.NET page, ASP.NET dynamically compiles an instance of the page class, which represents the code for the ASP.NET page, then caches the page class on the server for subsequent requests. (In fact, ASP.NET automatically caches many components—e.g., internal objects, such as server variables—to speed user access to them.) For subsequent page requests, ASP.NET executes the cached instance of the page class. However, if you change the original source code for an ASP.NET page or one of its dependencies, the JIT compiler automatically recompiles the page class.

The page class is usually part of a "code-behind" module—a separate physical file from the HTML file—that, together with the HTML file, makes up an ASP.NET page. The CLR JIT compiler compiles ASP.NET-managed page code to the processing server's native code at runtime.

Another performance advantage of ASP.NET is that it's factorable, which means that IIS administrators and developers can easily remove existing modules (e.g., a session-state module, a trace-logging module) that aren't relevant to the application they're developing. ASP.NET's extensive caching services include both built-in services and caching APIs.

Performance Monitoring
ASP.NET improves on ASP's performance monitoring. Whereas ASP exposes performance counters globally for an entire server, ASP.NET exposes many performance counters on a per-application basis. And in many cases, just one line of code adds a performance counter to an ASP.NET application.

You can view counters for an ASP.NET application under the ASP.NET Applications performance object in System Monitor. (To open System Monitor, open the Control Panel Administrative Tools applet and double-click Performance.) If you have multiple ASP.NET applications on your servers, you must select a particular application instance before selecting a counter to monitor. However, a special __Total__ application instance in System Monitor aggregates the performance-counter values for all applications on a server. For example, Figure 1 shows System Monitor monitoring __Total__ and the ASP.NET application _LM_w3svc_1_root_MyMSEvents, which my company wrote for Microsoft to manage large events such as TechEd, MEC, and Fusion.

ASP.NET also exposes global-only counters not bound to a particular application instance. To configure System Monitor to monitor performance of all global and application-specific counters, click the View Report (dog-eared report) icon next to the Add (plus symbol) icon in the Performance console. Next, click the Add icon. Select ASP.NET Applications from the Performance object drop-down menu, select All counters and All instances, then click Add. Next, select ASP.NET (System) from the Performance object drop-down menu, select All counters, then click Add.

   Previous  [1]  2  Next 


Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Friday at PASS Europe 2006

Kevin talks about the closing day of the event and shares a funny Microsoft film. ...

More fun TechEd 2005 Resources

Kevin points out some more TechEd resources ...

What service packs and fixes are available?

...


Development Whitepapers Batch Job Scheduling and .NET in 2008

Extended Validation SSL Certificates

Database Professionals: Experience Profile and Need Gaps in Development and Database Tools

Related Events Check out our list of Free Email Newsletters!

IIS and Web Administration eBooks Keeping Your Business Safe from Attack: Monitoring and Managing Your Network Security

Configurable components: More convenient versatility than custom parts

Synthetic Lubes Protect Electrical Connections, Reduce Warranty Claims

Related IIS and Web Administration Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.

Job Openings in IT


ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

Microsoft Exchange & Windows Connections event returns to Las Vegas Nov 10 - 13
Connections returns to Las Vegas for this exciting event where each attendee will receive SQL Server 2008 standard with 1 CAL. Co-located with Microsoft ASP.NET, SQL Server, and SharePoint Connections with over 250 in-depth sessions.

Free Online Event! Virtualization:Get the Facts!
Register now and attend this free, live in-depth online conference on November 13 and 20, 2008, produced by Windows IT Pro. All registrants are eligible to receive a complimentary one-year digital subscription to Windows IT Pro (a $49.95 value)!

Check Out Hyper-V Video on ITTV
Watch Karen Forster's interview on Hyper-V's performance on ITTV.net.

Ease Your Scripting Pains with the Flexibility of PowerShell!
Join MVP Paul Robichaux on December 11, 2008 at 11:00 AM EDT as he equips you with PowerShell basics in 3 introductory lessons, each followed by a live Q&A session—all on your own computer!

PASS Community Summit 2008 in Seattle on Nov 18-21
The don’t-miss event for Microsoft SQL Server Professionals. Register now and you’ll enjoy top-notch Microsoft and Community speakers and more.



Speed Up Your PC!
Try Diskeeper 2008 with InvisiTasking Free Now!

Get Protected -- Data Protection Manager 2007
Protect your virtualized environment with Data Protection Manager

Agent-less Remote Backup Service, Free 30 Day Trial
Award winning remote backup service at a competitive price with no min GB/month. Sign up Now!

ScriptLogic Cartoon Caption Contest
Submit your caption and you will be entered to win $198.42

List Your Products in Our Technology Resource Directory
Don't miss the chance to post your free listing in this comprehensive directory for IT and developer professionals, powered by Windows IT Pro. But hurry! Deadline ends Oct. 9.
Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing