根据 this MSDN for ProcessModel 中的文档,autoConfig=true 根据此设置以下属性 KB文章:
maxWorkerThreads、maxIoThreads、minFreeThreads、minLocalRequestFreeThreads、maxConnection
为了验证此设置,我在 ASP .NET 3.5 中有一个示例 Web 应用程序,在 page_load 事件中有以下代码:
int w, c;
ThreadPool.GetMinThreads(out w, out c);
// Write the numbers of minimum threads
Response.Write("Min: " + string.Format("{0}, {1}", w, c));
w=0;
c = 0;
ThreadPool.GetMaxThreads(out w, out c);
Response.Write(" Max: " + string.Format("{0}, {1}", w, c));
Response.Write(" Maxconnections: " + ServicePointManager.DefaultConnectionLimit);
Configuration conf = ConfigurationManager.OpenMachineConfiguration();
ConfigurationSectionGroup secGrp = conf.SectionGroups["system.web"];
ConfigurationSection sec = secGrp.Sections["httpRuntime"];
Response.Write(" httpruntime settings: " + sec.ElementInformation.Properties["minFreeThreads"].Value + ", " +
sec.ElementInformation.Properties["minLocalRequestFreeThreads"].Value);
Response.Flush();
当我首先将 autoConfig 设置为 false 然后设置为 true 运行页面时,我得到以下输出:
autoConfig=false: Min: 2, 2 Max: 40, 40 Maxconnections: 10 httpruntime 设置: 8, 4
autoConfig=true: Min: 2, 2 Max: 200, 200 Maxconnections: 24 httpruntime 设置: 8, 4
autoConfig=false 按预期工作,默认值可以在输出中看到,但是设置为 true 时的输出让我有点惊讶:
我有点困惑,对这里发生的事情有什么想法吗?我弄错了 sample 还是什么?
最佳答案
我的猜测是您正在处理以下相同类型的逻辑:
WCF 4: Higher Default Throttling Settings for WCF Services
在 WCF 4 中,我们修改了这些设置的默认值,以便人们在大多数情况下不必更改默认值。以下是主要变化:
· MaxConcurrentSessions:默认为 100 * 处理器数量
· MaxConcurrentCalls:默认为 16 * 处理器数量
· MaxConcurrentInstances:默认为上述两者的总和,与之前的模式相同。
关于asp.net - ASP .NET ProcessModel 配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4310719/