根据中的这文档,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最大值: 40,40个Maxconnections: 10个httpruntime设置: 8,4
autoConfig=true: Min: 2,2最大值: 200,200个Maxconnections: 24个httpruntime设置: 8,4
autoConfig=false按预期工作,默认值可以在输出中看到,但是,当设置为true时,输出会稍微通知我:
我有点困惑,对这里发生了什么有什么想法吗?我把样本搞错了吗?
发布于 2011-08-25 02:49:26
我猜你所处理的逻辑如下:
WCF 4: WCF服务的更高默认节流设置
在WCF 4中,我们已经修改了这些设置的默认值,以便人们在大多数情况下不必更改默认值。以下是主要的变化:
·MaxConcurrentSessions:默认为100 * ProcessorCount
·MaxConcurrentCalls:默认为16 * ProcessorCount
·MaxConcurrentInstances:缺省值是上述两种模式的总和,与以前的模式相同。
https://stackoverflow.com/questions/4310719
复制相似问题