• 让Windows Server 2008 + IIS 7+ ASP.NET 支持10万个同时请求


    Error Summary:

    HTTP Error 503.2 - Service Unavailable
    The serverRuntime@appConcurrentRequestLimit setting is being exceeded. 

    Detailed Error Information:

    Module IIS Web Core 
    Notification BeginRequest 
    Handler StaticFile 

    Error Code 0x00000000

    由于之前使用的是默认配置,服务器最多只能处理5000个同时请求,今天下午由于某种情况造成同时请求超过5000,从而出现了上面的错误。

    为了避免这样的错误,我们根据相关文档调整了设置,让服务器从设置上支持10万个同时请求。

    具体设置如下:

    1. 调整IIS 7应用程序池队列长度

    由原来的默认1000改为65535。

    IIS Manager > ApplicationPools > Advanced Settings

    Queue Length : 65535

    2.  调整IIS 7的appConcurrentRequestLimit设置

    由原来的默认5000改为100000。

    c:\windows\system32\inetsrv\appcmd.exe set config /section:serverRuntime /appConcurrentRequestLimit:100000

    在%systemroot%\System32\inetsrv\config\applicationHost.config中可以查看到该设置:

    <serverRuntime appConcurrentRequestLimit="100000" /> 

    3. 调整machine.config中的processModel>requestQueueLimit的设置

    由原来的默认5000改为100000。

    <configuration>
        
    <system.web>
            <processModel requestQueueLimit="100000"/>  

    参考文章:http://technet.microsoft.com/en-us/library/dd425294(office.13).aspx

    4. 修改注册表,调整IIS 7支持的同时TCPIP连接数

    由原来的默认5000改为100000。

    reg add HKLM\System\CurrentControlSet\Services\HTTP\Parameters /v MaxConnections /t REG_DWORD /d 100000 

    完成上述4个设置,就可以支持10万个同时请求,博客园博客服务器已经启用上述设置。 

  • 相关阅读:
    208. Implement Trie (Prefix Tree)
    97. Interleaving String
    314. Binary Tree Vertical Order Traversal
    windows获取IP和MAC地址【Qt】
    阳历阴历转换
    getDat(char *val)获得某一天是这一年中的第几天
    int位数的获取及int类型转char *
    以二进制形式输出char *数据
    char类型变量二进制形式输出
    int类型变量以二进制形式输出
  • 原文地址:https://www.cnblogs.com/bulege/p/2456493.html
Copyright © 2020-2023  润新知