根据MSDN for ProcessModel中的this文档,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 settings:8,4
autoConfig = true:Min:2,2 Max:200,200 Maxconnections:24 httpruntime settings:8,4
autoConfig = false按预期工作,输出中可以看到默认值,但设置为true时的输出让我感到有些惊讶:
我有点困惑,关于这里发生了什么的任何想法?我的样本有错吗?
答案 0 :(得分:0)
我的猜测是你正在处理以下同样的逻辑:
WCF 4: Higher Default Throttling Settings for WCF Services
在WCF 4中,我们修改了这些设置的默认值,以便人们在大多数情况下不必更改默认值。以下是主要变化:
·MaxConcurrentSessions:默认为 100 * ProcessorCount
·MaxConcurrentCalls:默认为 16 * ProcessorCount
·MaxConcurrentInstances:默认值是以上两者的总和,它遵循与之前相同的模式。