首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >ASP .NET ProcessModel配置

ASP .NET ProcessModel配置
EN

Stack Overflow用户
提问于 2010-11-30 05:10:17
回答 1查看 3.3K关注 0票数 5

根据中的文档,autoConfig=true根据这篇KB文章设置以下属性:

maxWorkerThreads,maxIoThreads,minFreeThreads,minLocalRequestFreeThreads,maxConnection

为了验证此设置,我在ASP .NET 3.5中有一个示例web应用程序,它在page_load事件中具有以下代码:

代码语言:javascript
运行
复制
        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时,输出会稍微通知我:

  1. 它确实正确地设置了maxWorkerThreads和maxIoThreads属性,因此输出为200 (双核CPU上的100x2)。
  2. 但是,它似乎没有设置minWorkerThreads属性,按照KB应该是: minWorkerThreads =maxWorkerThread/2
  3. 此外,根据MSDN文档设置,autoConfig=true确实将minFreeThreads和minLocalRequestFreeThreads属性设置为KB中推荐的值,但情况似乎并非如此。我得到默认值8和4。

我有点困惑,对这里发生了什么有什么想法吗?我把样本搞错了吗?

EN

回答 1

Stack Overflow用户

发布于 2011-08-25 02:49:26

我猜你所处理的逻辑如下:

WCF 4: WCF服务的更高默认节流设置

在WCF 4中,我们已经修改了这些设置的默认值,以便人们在大多数情况下不必更改默认值。以下是主要的变化:

·MaxConcurrentSessions:默认为100 * ProcessorCount

·MaxConcurrentCalls:默认为16 * ProcessorCount

·MaxConcurrentInstances:缺省值是上述两种模式的总和,与以前的模式相同。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4310719

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档