IIS/ WCF throttling

https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/web/applicationpool-element-web-settings

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config

^自已執生

The 64-bit runtime uses a different machine.config. The basic rules are this:
  1. ASP.NET 1.x uses %WINDIR%\Microsoft.NET\Framework\v1.1.4322
  2. ASP.NET 2.0 / 3.5 x86 uses %WINDIR%\Microsoft.NET\Framework\v2.0.50727
  3. ASP.NET 2.0 / 3.5 x64 uses %WINDIR%\Microsoft.NET\Framework64\v2.0.50727
  4. ASP.NET 4.0 / 4.5.x x86 uses %WINDIR%\Microsoft.NET\Framework\v4.0.30319
  5. ASP.NET 4.0 / 4.5.x x64 uses %WINDIR%\Microsoft.NET\Framework64\v4.0.30319
  6. For ASP.NET 5.0 using the Full CLR, this will be the same as the ASP.NET 4.0 locations since the .NET Framework 4.6 is a drop in replacement for 4.5. If ASP.NET 5.0 is running on the CoreCLR, there is no concept of a machine.config file.
Which version of ASP.NET you use depends on your ASP.NET Tab (IIS 6) or AppPool (IIS 7+)
x64 vs. x86 depends on the metadata setting W3SVC/AppPools/Enable32BitAppOnWin64 for IIS 6, or the AppPool in IIS 7.
https://stackoverflow.com/questions/9233985/which-machine-config-file-is-my-solution-using-on-the-server


   <system.web>
      <applicationPool 
         maxConcurrentRequestsPerCPU="1" 
         maxConcurrentThreadsPerCPU="0" 
         requestQueueLimit="1000" />
   </system.web>
</configuration>

以上係application pool 果層, 落到去WCF層面, 可以係web.config度咁做:

  <services> 
       <service name="WcfTest.Service1"  behaviorConfiguration="NewBehavior0">
        <endpoint binding="basicHttpBinding" contract="WcfTest.IService1"/>
...(略)

 <behavior name="NewBehavior0">
          <serviceThrottling maxConcurrentCalls="100" maxConcurrentInstances="100" maxConcurrentSessions ="200"   />
        </behavior>



Default 係16 Threads per core
下圖係同時send N 個要做一秒既task上去, 見到concurrency去到17 就開始要2秒

  • MaxConcurrentCalls – the number of concurrent calls that can be made – under .NET 4 defaults to 16 x number of cores

留言

這個網誌中的熱門文章

msdeploy include ApplicationPool setting and ignore recycle time

Invoke generic method