MC Press Online

Wednesday, May 24th

Last updateMon, 22 May 2017 4pm

You are here: Home ARTICLES Programming Programming - Other Microsoft TechTip: IIS 6.0 Best Practices to Improve Performance of ASP.NET Applications

Programming / Microsoft

TechTip: IIS 6.0 Best Practices to Improve Performance of ASP.NET Applications

Support MC Press - Visit Our Sponsors

NEW BOOK!

Evolve Your RPG Coding: Move from OPM to ILE ... and Beyond


ORDER YOUR COPY

*******************

Click for this Month's

Bookstore Special Deals

Leverage IIS 6.0's built-in features, including MetaBase auditing, file expiration, HTTP compression, and more.

 

Internet Information Services (IIS) is a flexible, scalable, easy to use and manage Web server that can be used to host your Web sites and run applications on the Web seamlessly.

 

Wikipedia states, "Internet Information Services (IIS) - formerly called Internet Information Server - is a set of Internet-based services for servers created by Microsoft for use with Microsoft Windows. It is the world's second most popular Web server in terms of overall websites behind the industry leader Apache HTTP Server. As of April 2009, it served 29.27% of all websites according to Netcraft. The services provided currently include FTP, FTPS, SMTP, NNTP, and HTTP/HTTPS."

 

Web sites deployed on IIS 6.0 execute on separate worker processes and threads. These are not only independent of each other, but also independent of the IIS WWW Service process. Note that the WWW service is one of the most important services in IIS. It reads information from the IIS Admin service at the time when it starts. 

This isolation makes IIS 6.0 much more stable than any previous versions of IIS.

How Do I Get IIS 6.0?

IIS 6.0 is tightly integrated with the Windows Server 2003. IIS 6.0 offers better reliability, robust security, easier manageability, and improved performance and scalability compared to its earlier counterparts. You can download a copy of the IIS 6.0 Resource Kit here.

Managing IIS: Tips and Techniques

You can enable HTTP compression in IIS 6.0 using the IIS snap-in. To do this, follow these steps:

  1. Open the IIS snap-in.
  2. Right-click on the Web sites node and then click on Properties.
  3. Switch to the Services tab.
  4. Enable the options to "Compress Static Files" and "Compress Application Files."

 

You can also enable compression by using the following statements at the command line:

 

cscript C:InetpubAdminScriptsadsutil.vbs set w3svc/site#/root/DoStaticCompression True

 

cscript C:InetpubAdminScriptsadsutil.vbs set w3svc/site#/root/DoDynamicCompression True

 

You just need to replace the site# with the site ID you would like to change.

 

To enable centralized logging, you may use this statement:

 

cscript adsutil.vbs set w3svc/CentralW3CLoggingEnabled 1

 

If you would like to enable IIS MetaBase auditing, use this statement at the command prompt:

 

cscript iiscnfg.vbs /enableaudit / /r

 

Note that before you make any changes to the IIS MetaBase, you can take a backup of it. To create a backup of the IIS 6.0 MetaBase, open the IIS snap-in and then select All Tasks > Backup/Restore Configuration. The remaining steps are simple. The IIS MetaBase is present in the file called MetaBase.xml in your WINDOWSsystem32inetsrv directory in your system. You can take a look at this article for information on how to take IIS 6.0 MetaBase backup: http://www.visualwin.com/IIS-Backup/

Best Practices

Here is a list of some other best practices that you can follow to improve the performance of applications deployed on IIS 6.0:

  • File Expiration Policy—Set the file expiration dates for files to considerably reduce subsequent access load times.
  • HTTP Compression—Enable HTTP compression in IIS to compress the content to be rendered and hence increase the efficiency of bandwidth usage.
  • Optimize the Load Time—Remove redundant tags, reduce scripts and arrays, avoid using nested tables, consolidate multiple scripts into a single file, consolidate multiple images into a single file, and pre-load images to reduce the initial load time of Web pages in your application. You can also pre-compile your Web sites before they are deployed in IIS to boost the application's performance.
  • Performance Counters—Measure performance using Performance Counters for IIS 6.0. Performance Counters are objects that collect information related to the system's and the application's performance.
  • Application Pools—Improve the application performance by using separate application pools for your application. Application pools are self-contained processes that can communicate with the kernel of the host operating system. These can be used to isolate ASP.NET Web applications, thereby increasing the security and performance of ASP.NET Web applications deployed on top of IIS.
  • Efficient Code—Write code that consumes less memory and resources. There are lots of strategies in this regard. You can check an article I wrote for more information.

 

You can also test the load time of the Web pages of your application by using network bandwidth measuring tools like network monitors, load simulators, etc. This will give you an idea of how much time is being spent to load a particular Web page in your application. Accordingly, you can take steps to reduce the load time of pages that are frequently used but take a longer time to load. Actually, there isn't any particular rule or methodology that fits every scenario. You should plan and set some objectives and then check whether your development cycle conforms to the objectives and standards you set.

Suggested Readings

Here are links to some good references on this topic for further study:

 

 

Summary

In this article, we have examined some of the best practices that can be followed to improve application performance of applications that are deployed in IIS. You can find out more about how to efficiently enhance application performance of ASP.NET applications in my latest book, ASP.NET 4.0 Programming (McGraw-Hill/Osborne Media).

Joydip Kanjilal

Joydip Kanjilal is a Principal Software Engineer in Hyderabad, India.

Read my blog

Awarded the prestigious Microsoft Most Valuable Professional (MVP) award in ASP.NET six times in a row from the year 2007 to 2012. A speaker and author of several books and articles with over 18 years of industry experience in IT and more than 14 years in Microsoft .NET and its related technologies.

Currently working as a Principal Software Engineer at DELL International Services at Hyderabad. Was selected as an MSDN Featured Developer of the Fortnight (MSDN) a number of times and also Community Credit Winner at www.community-credit.com several times.

Authored the following books:

·  Entity Framework Tutorial (Second Edition) by Packt Publishing

·  ASP.NET Web API: Build RESTful Web Applications and Services on the .NET Framework by Packt Publishing

·  Visual Studio 2010 and .NET 4 Six-in-One by Wrox Publishers

·  ASP.NET 4.0 Programming by McGraw Hill Publishing

·  Entity Framework Tutorial by Packt Publishing

·  Pro Sync Framework by APRESS

·  Sams Teach Yourself ASP.NET AJAX in 24 Hours by Sams Publishing

·  ASP.NET Data Presentation Controls Essentials by Packt Publishing

Also reviewed more than 10 books and authored more than 350 articles for some of the most reputable sites, such as www.msdn.microsoft.com, www.code-magazine.com, www.asptoday.com, www.devx.com, www.ddj.com, www.aspalliance.com, www.aspnetpro.com, www.sql-server-performance.com, www.sswug.com, and so on.

Has years of experience in designing and architecting solutions for various domains. His technical strengths include C, C++, VC++, Java, C#, Microsoft .NET, AJAX, WCF, JQuery, ASP.NET Web API, REST, SOA, Design Patterns, SQL Server, Operating Systems, and Computer Architecture. Has been exploring Cloud technologies, IoT and Machine learning these days.

Blog: http://www.infoworld.com/blog/microsoft-coder

Website: www.joydipkanjilal.com

Twitter: https://twitter.com/joydipkanjilal

Facebook: https://www.facebook.com/joydipkanjilal

LinkedIn: http://in.linkedin.com/in/joydipkanjilal

BLOG COMMENTS POWERED BY DISQUS