February 1008

Machine.config changes for Production

On Thursday my company’s new website went live but that’s not the point of this post; this post is more to do with optimising the server / site now it is in production.

All .NET websites inherit their settings from other .config files that exist ‘lower’ down the chain; so a web.config in the root of the wwwroot folder can contain settings that apply to all websites on that server. However going lower still is the machine.config and settings made here apply to the machine generally. Here I am going to make some changes to the machine.config to harden the production server and give a slight boost to performance. I don’t have any statistics to back up the settings, they are based on a bit of trial & error and an article on tuning IIS 6.0 your mileage with these may vary.

The machine.config can be found at C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG or C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG depending on your OS. Be careful when editing this file as you can stop things from working with something as simple as an invalid xml node or not closing something properly, so I usually create a backup copy before I start making changes.

<Deployment="retail" /> is quite well known, but I keep forgetting where it belongs so here are the changes I made – for future reference as much as anything else.

<system.web>
   <deployment retail="true" />
   <processModel
     autoConfig="true"
     memoryLimit="75″
     maxIoThreads="100″
     minIoThreads="30″
     minWorkerThreads="40″
     maxWorkerThreads="100″
     clientConnectedCheck="00:00:05″ />
...
</system.web>
 

With deployment = retail set all web applications compile without debug enabled, essentially if you forget to set debug=”false” this will take care of that, and a few other settings you would want.

The settings in the processModel node are all set to their default (autoConfig=true), except for those that I’m overriding. The memoryLimit is the % memory a web process can use before creating a new process. I’m only using this server for a few sites so will happily set this quite high. The clientConnectedCheck instructs the server to check every 5 seconds to see if the client is connected and if not then to dump any outstanding requests they’ve made – garbage collecting.

Permalink | Comments (1)

Comments

  1. trackback WOMBAT (Friday, March 19, 2010) #

    URL Rewriting and problems with web-services

    URL Rewriting and problems with web-services

Comments are closed