Programming / Microsoft
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:
- Open the IIS snap-in.
- Right-click on the Web sites node and then click on Properties.
- Switch to the Services tab.
- 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/
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.
Here are links to some good references on this topic for further study:
- informIT's "Optimizing and Performance Tuning IIS 6.0"
- TechRepublic's "Tips and Tricks for Optimizing Performance in IIS 6.0 - Level 300"
- TechRepublic's "What's New in IIS 7"
- Microsoft's "Managing IIS 6 in an Enterprise: A Handful of Tips & Tricks"
- Microsoft's "IIS 6.0 Performance Tune-Up"
- Microsoft's IIS Videos
- Microsoft's "IIS Compression in IIS6.0"
- Microsoft's "How To Create a Metabase Backup by Using IIS 6.0 in Windows Server 2003"
- Microsoft's "Overview â€“ What Problem Does IIS Compression Solve?"
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).