ASP.NET WCF 优化部署

优化内容

ASP.NET的优化部署

  1. machine.config
    位置:<system.web>,以下配置项数值对应CPU逻辑核心。
    <processModel enable="true" maxWorkerThreads="500" maxIoThreads="500" minWorkerThreads="250" minIoThreads="250" /> 
    
    来自 https://msdn.microsoft.com/en-us/library/7w2sway1(v=vs.100).aspx
  2. Aspnet.config
    以下是默认值,根据业务情况可不改
    <configuration>  
      <system.web>  
        <applicationPool   
            maxConcurrentRequestsPerCPU="5000"  
            maxConcurrentThreadsPerCPU="0"   
            requestQueueLimit="5000" />  
      </system.web>  
    </configuration>  
    
    
    来自 https://msdn.microsoft.com/en-us/library/dd560842.aspx
  3. IIS设置
    位置:服务器下的ASP属性
    在这里插入图片描述
  4. 应用程序池
    在这里插入图片描述

WCF的优化部署

  1. Web.config
    用来设置并发优化,对应CPU逻辑核心
    <system.serviceModel>
       <behaviors>
         <serviceBehaviors>
           <behavior>
             <serviceThrottling
               maxConcurrentCalls="100"
               maxConcurrentInstances="100"
               maxConcurrentSessions="100"
               />
           </behavior>
         </serviceBehaviors>
       </behaviors>
     </system.serviceModel>
    

ASP.NET的回收相关

  1. 应用程序池不要设定定期回收,以免用户正在使用时发生回收
    在这里插入图片描述

作为客户端时连接数的增加

  1. Machine.config或app.config或web.config
    <configuration>
      <system.net>
        <connectionManagement>
          <add address = "*" maxconnection = "500" />
        </connectionManagement>
      </system.net>
    </configuration>
    
    来自 https://msdn.microsoft.com/en-us/library/fb6y0fyc(v=vs.100).aspx

参考文献

  1. Improving ASP.NET Performance
    来自 https://msdn.microsoft.com/en-us/library/ms998549.aspx
  2. Optimizing IIS Performance
    来自 https://msdn.microsoft.com/en-us/library/ee377050(v=bts.10).aspx
  3. Contention, poor performance, and deadlocks when you make calls to Web services from an ASP.NET application
    来自 https://support.microsoft.com/en-us/help/821268/contention,-poor-performance,-and-deadlocks-when-you-make-calls-to-web-services-from-an-asp.net-application
  4. ASP.NET Thread Usage on IIS 7.5, IIS 7.0, and IIS 6.0
    来自 https://blogs.msdn.microsoft.com/tmarq/2007/07/20/asp-net-thread-usage-on-iis-7-5-iis-7-0-and-iis-6-0/
  5. processModel Element (ASP.NET Settings Schema)
    来自 https://msdn.microsoft.com/en-us/library/7w2sway1(v=vs.100).aspx
  6. Element (Web Settings)
    来自 https://msdn.microsoft.com/en-us/library/dd560842.aspx
  7. Element (Network Settings)
    来自 https://msdn.microsoft.com/en-us/library/fb6y0fyc(v=vs.100).aspx
  8. Quick Ways to Boost Performance and Scalability of ASP.NET, WCF and Desktop Clients
    来自 https://www.codeproject.com/Articles/133738/Quick-Ways-to-Boost-Performance-and-Scalability-of

猜你喜欢

转载自blog.csdn.net/InJra_p/article/details/89926491