9

A regular ASP.NET installation will create machine.config with the following configuration:

<system.web>
    <processModel autoConfig="true" />  

I would like to override few properties values in web.config like:

<system.web>
   <processModel 
     maxWorkerThreads="100" 
     maxIoThreads="100" 
     minWorkerThreads="40" 
     minIoThreads="30" 
     memoryLimit="60" 
   />

I would like to know that whether i have to write all default properties inside web.config or it will automatically take other default properties of processmodel from machine.config?

Following are the properties of processmodel

<processModel 
   enable="true|false"
   timeout="hrs:mins:secs|Infinite" 
   idleTimeout="hrs:mins:secs|Infinite"
   shutdownTimeout="hrs:mins:secs|Infinite"
   requestLimit="num|Infinite"
   requestQueueLimit="num|Infinite"
   restartQueueLimit="num|Infinite"
   memoryLimit="percent"
   webGarden="true|false"
   cpuMask="num"
   userName="{username}"
   password="{secure password}"
   logLevel="All|None|Errors"
   clientConnectedCheck="hrs:mins:secs|Infinite"
   comAuthenticationLevel="Default|None|Connect|Call| 
               Pkt|PktIntegrity|PktPrivacy"
   comImpersonationLevel="Default|Anonymous|Identify|
               Impersonate|Delegate"
   responseDeadlockInterval="hrs:mins:secs|Infinite"
   responseRestartDeadlockInterval="hrs:mins:secs|Infinite"
   autoConfig="true|false"
   maxWorkerThreads="num"
   maxIoThreads="num"
   minWorkerThreads="num"
   minIoThreads="num"
   serverErrorMessageFile="" 
   pingFrequency="Infinite" 
   pingTimeout="Infinite" 
   maxAppDomains="2000"
/>
o.k.w
  • 25,490
  • 6
  • 66
  • 63
Hemant Kothiyal
  • 4,092
  • 19
  • 61
  • 80

3 Answers3

4

Machine.config is always inherited.

From MSDN:

Multiple configuration files, all named Web.config, can appear in multiple directories on an ASP.NET Web application server. Each Web.config file applies configuration settings to its own directory and all child directories below it. Configuration files in child directories can supply configuration information in addition to that inherited from parent directories, and the child directory configuration settings can override or modify settings defined in parent directories. The root configuration file named systemroot\Microsoft.NET\Framework\versionNumber\CONFIG\Machine.config provides ASP.NET configuration settings for the entire Web server.

bzlm
  • 9,626
  • 6
  • 65
  • 92
  • 1
    Thanks, Actually i have a doubt; because in machine.config there is only single property "autoConfig="true" but in web.config we are writing specific property name. If this is confirm that all hidden property is automatically inherited in web.config then it is good. – Hemant Kothiyal Dec 21 '09 at 10:17
  • 1
    That's not how it works. Machine.config and Web.config are merged at runtime, so AutoConfig is either true or false. AutoConfig does not configure inheritance. See more here: http://msdn.microsoft.com/en-us/library/system.web.configuration.processmodelsection.autoconfig(VS.100).aspx – bzlm Dec 25 '09 at 19:31
  • If you look in machine.config you'll see something like
    which means you cannot take this advice and set these settings in Web.Config.
    – kamens May 12 '10 at 17:13
  • 2
    @kamens If you change `allowDefinition` to `MachineToApplication` in `Machine.config` you can. Beware, though, that changes to `processModel` *will require an application pool restart even when* defined in `Web.config`. – bzlm May 15 '10 at 13:52
2

It seems we cannot override the processModel settings in web.config as per the below link.

http://msdn.microsoft.com/en-us/library/ms178685.aspx

EDIT : I didn't read the comments. We can set MachineToApplication value which requires machine reboot it seems. Any idea what will be the side effects?

Thanks.

Raja
  • 429
  • 4
  • 16
0

Does it make sense to answer the question now? I did a test to change the value, and using the IIS Configuration Manager, I see that the value is updated. Of course the change in on the machine.config file, to it applies to all the sites. I did not find a way to set the value per site.

Default value: 20

After changing the config

The machine.config has the following

   <processModel autoConfig="false" maxIoThreads="250" />

I did not need to set the rest of the values.

Andrea
  • 2,059
  • 2
  • 14
  • 15