加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – ASP .NET ProcessModel配置

发布时间:2020-12-16 07:39:11 所属栏目:asp.Net 来源:网络整理
导读:根据MSDN for ProcessModel中的 this文档,autoConfig = true根据此 KB文章设置以下属性: maxWorkerThreads,maxIoThreads,minFreeThreads,minLocalRequestFreeThreads,maxConnection 为验证此设置,我在ASP .NET 3.5中有一个示例Web应用程序,在page_load事件
根据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},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时的输出让我感到有些惊讶:

>它确实正确设置了maxWorkerThreads和maxIoThreads属性,因此输出为200(双核CPU上为100×2).
>但是,它似乎没有设置minWorkerThreads属性,根据KB应该是:minWorkerThreads = maxWorkerThreads / 2
>此外,根据MSDN文档设置autoConfig = true确实将minFreeThreads和minLocalRequestFreeThreads属性设置为KB中建议的值,但似乎也不是这样.我得到默认值8和4.

我有点困惑,关于这里发生了什么的任何想法?我有错误的样品吗?

解决方法

我的猜测是你正在处理以下相同的逻辑:

WCF 4: Higher Default Throttling Settings for WCF Services

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

·MaxConcurrentSessions:默认值为100 * ProcessorCount

·MaxConcurrentCalls:默认值为16 * ProcessorCount

·MaxConcurrentInstances:默认值是以上两者的总和,它遵循与之前相同的模式.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读