ASP.NET进程模型配置优化
ASP.NET进程模型配置定义了一些进程级别的属性,像ASP.NET使用的线程数量、超时前阻止线程花费了多长时间、多少请求在继续等待IO工作完成等等。默认情况下,很多方面都具有太多的限制。当今,硬件已经变得十分便宜了,即使是采用双核多GB的RAM服务器也变得非常平常的选择了。
因此,ASP.NET进程模型配置能够减少ASP.NET进程消耗更多的系统资源并提供为每台服务器提供更好的扩展性。
执行一次规则的ASP.NET安装将会在machine.config文件中创建如下配置的节点:
- <system.web>
- <processModel autoConfig="true" />
你需要减少这种自动配置并针对不同的特性使用一些特定的值以便自定义ASP.NET工作者进程的工作方式。例如:
- <processModel
- enable="true"
- timeout="Infinite"
- idleTimeout="Infinite"
- shutdownTimeout="00:00:05"
- requestLimit="Infinite"
- requestQueueLimit="5000"
- restartQueueLimit="10"
- memoryLimit="60"
- webGarden="false"
- cpuMask="0xffffffff"
- userName="machine"
- password="AutoGenerate"
- logLevel="Errors"
- clientConnectedCheck="00:00:05"
- comAuthenticationLevel="Connect"
- comImpersonationLevel="Impersonate"
- responseDeadlockInterval="00:03:00"
- responseRestartDeadlockInterval="00:03:00"
- autoConfig="false"
- maxWorkerThreads="100"
- maxIoThreads="100"
- minWorkerThreads="40"
- minIoThreads="30"
- serverErrorMessageFile=""
- pingFrequency="Infinite"
- pingTimeout="Infinite"
- asyncOption="20"
- maxAppDomains="2000"
- />
【编辑推荐】