IIS settings to improve ASP.NET Website Performance

This article helps you to understand required IIS settings to improve ASP.NET Website Performance.


IIS Logging:

IIS by default logs lot of data like client IP address, User Name, Method, URI stem, Protocol status, User agent and lot of other attributes. All of those attributes are not required by your application. You can easily customize what data to log and what to avoid. This results in reduced bandwidth.

Follow below steps to customize IIS logging.

1. Open IIS manager (inetmgr).

2. Click on <server name> -> Sites -> <your site>

3. Double click on Logging module from middle pane of window.

4. From new window click on Select Fields

5. You will see a new window where you can select or de select logging attributes. Click Ok and from parent window right pane click Apply.

customize IIS Logging

You can also Disable IIS logging. Follow below steps to disable it.

1. Open IIS manager (inetmgr).

2. Click on <server name> -> Sites -> <your site>

3. Double click on Logging module from middle pane of window.

4. You will see IIS logging feature window. From right pane of IIS logging window click on Disable


HTTP Compression

Enable Static content compression in IIS, it helps to compress static contents requests. Enabling static compression gives you more efficient use of bandwidth.

You can also enable compression for dynamic content however it includes runtime cost to process dynamic content, it may degrade CPU resources performance. So it is not really helpful.

Follow below steps to Enable HTTP Compression in IIS

1. Open IIS manager (inetmgr).

2. Click on <server name> -> Sites -> <your site>

3. Double click on Compression feature.

4. You will see check boxes to enable Dynamic content and Static Content. Make sure check box for Static content is checked.

Dynamic content compression module is not installed by default in system. You have to install it using Server Manager -> Role services.

You may check for more detail way of enable httpCompression for asp.net web sites


Output cache

Caching is important feature of application, it helps for improving speed of IIS response time by taking copy of a webpage visited by most recent user. If another user make request to same page stored in cache, IIS respond with copy from its cache without reprocessing the contents. Output caching significantly improve server response time for contents.

Follow below steps to Enable Output Caching

1. Open IIS manager (inetmgr).

2. Click on <server name> -> Sites -> <your site>

3. Double click on Compression feature.


HTTP expires header

It directs client's browser to cache webpages and its elements like css, scripts, images etc. It helps to minimize the number of http requests send to IIS by website visitors.

To set value for this. Follow below steps

1. Open IIS manager (inetmgr).

2. Select website for which you want to make settings for headers.

3. Double click on Http Response Headers

4. From Action pane (right pane) click on Set Common Headers.

5. Check Expire Web Content and desired value. One year is recommended.


Classic ASP module

To configure classic ASP websites IIS has ASP module. If you do not have classic ASP code you can disable this module from IIS.

If you have classic ASP code make sure you have configured below settings.

1. Disable IIS debugging: Open ASP feature from IIS Select Compilation -> Debugging Properties

Set Enable Client Side Debugging and Enable Server Side debugging as false.

IIS ASP Module


ASP Threads Per Processor Unit

It specifies the maximum number of worker threads can be created. The default value is 25 and maximum can be 100. The ideal value for this is the number of threads that can consume less than 50% of processor time. You can set it to 50 and test performance. See more tips on ASP.NET Website Performance Improvement

For setting this value open ASP module from IIS -> click on Limits Properties and set value for Threads Per Processor Unit.


ASP Queue Length property

This property decides how often server should send error 503 (Server is too busy). When you set value too low server will send error 503 frequently and if you set it too high server will wait till the existing requests processed and responsiveness to user will be low. Watch queue on high traffic and set value accordingly.

If you do not have details for setting value of ASP Queue Length property, set it to the value of Threads Per Processer * Number of Processers. For example, if the ASP Threads Per Processor Limit property is 25 and you have four processors (4 * 25 = 100 threads), you can set it to 100.

For setting this value open ASP module from IIS -> click on Limits Properties and set value for Queue Length.

Speak your mind :
Leave a comment for this article on dotnetbloogers.com