5

According to this documentation in MSDN for ProcessModel, the autoConfig=true sets the following attributes in accordance with this KB article:

maxWorkerThreads, maxIoThreads, minFreeThreads, minLocalRequestFreeThreads, maxConnection

To verify this setting, I have a sample web application in ASP .NET 3.5 having the following code in the page_load event:

        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();

I get the following output when I run the page with autoConfig set to false first and then set to 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 works as expected and the default values can be seen in the output, however the output when set to true suprised me a bit:

  1. It does set the maxWorkerThreads and maxIoThreads attributes correctly and hence the output of 200 (100x2 on a dual core CPU).
  2. However, it doesn't seem to set the minWorkerThreads attribute which as per the KB should be: minWorkerThreads = maxWorkerThreads/2
  3. Also, according to the MSDN documentation setting autoConfig=true does set the minFreeThreads and minLocalRequestFreeThreads attribute to values recommended in the KB, but that doesn't seem to be the case either. I get the default values of 8 and 4.

I am a bit confused, any ideas as to what's happening here? Have i got the sample wrong or something?

agp
  • 363
  • 5
  • 13
  • I'm trying to improve my webservice throughput (currently getting 100% CPU load for only a few users) and I ran into the exact same issue. I get 20 for MaxWorkerThreads when AutoConfig is enabled. – R4cOOn Jan 17 '11 at 13:05
  • I am running ASP.NET 3.5 app in IIS6 on dual core machine and I am getting same results as you. – Jakub Šturc Apr 13 '11 at 11:47
  • Something amiss, not sure what? We ended up tinkering the settings manually in web.config after setting the AutoConfig attribute to false! – agp Aug 09 '11 at 05:57

1 Answers1

0

My guess is you are dealing with the same kind of logic below:

WCF 4: Higher Default Throttling Settings for WCF Services

In WCF 4, we have revised the default values of these settings so that people don’t have to change the defaults in most cases. Here are the main changes:

· MaxConcurrentSessions: default is 100 * ProcessorCount

· MaxConcurrentCalls: default is 16 * ProcessorCount

· MaxConcurrentInstances: default is the total of the above two, which follows the same pattern as before.

rick schott
  • 21,012
  • 5
  • 52
  • 81