zoukankan      html  css  js  c++  java
  • WCF并发连接数的问题

    在最近的开发中,总是发现人数一多就会有用户莫名其妙的界面卡死,或者直接掉线的情况,不知道是什么原因,由于项目采用的是netTcp绑定,猜想可能是并发连接的问题。于是查了一下:

    在windows7中,并发连接数默认是10

      
    代码
    <binding name="netTcpBindConfig" closeTimeout="00:30:00" 
    openTimeout
    ="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00" 
    transactionFlow
    ="false" transferMode="Buffered" transactionProtocol="OleTransactions" 
    hostNameComparisonMode
    ="StrongWildcard" listenBacklog="10" 
    maxBufferPoolSize
    ="2147483647" maxBufferSize="2147483647" maxConnections="10" 
    maxReceivedMessageSize
    ="2147483647"> 

    将项目移植到windows server2008上之后,并发连接数需要改变一下,于是变成

      
    代码
    <binding name="netTcpBindConfig" closeTimeout="00:30:00" 
    openTimeout
    ="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00" 
    transactionFlow
    ="false" transferMode="Buffered" transactionProtocol="OleTransactions" 
    hostNameComparisonMode
    ="StrongWildcard" listenBacklog="10" 
    maxBufferPoolSize
    ="2147483647" maxBufferSize="2147483647" maxConnections="1000" 
    maxReceivedMessageSize
    ="2147483647"> 

    但是问题依然存在,就想到是不是需要配置一下行为,于是将行为的连接数量也改变了

      
    代码
    <behavior name="JXSoft.JPlan.WCFService.Behavior" > 
    <serviceThrottling maxConcurrentCalls="1000" maxConcurrentInstances="1000" maxConcurrentSessions="1000"/> 
    <serviceMetadata/> 
    <serviceDebug includeExceptionDetailInFaults="true" /> 
    <dataContractSerializer maxItemsInObjectGraph="6553600"/> 
    </behavior>
     

    问题解决,没有再出现过卡死或者掉线情况.

  • 相关阅读:
    Solidity通过合约转ERC20代币
    各种开源协议区别
    shell脚本之函数
    shell脚本之循环和循环控制
    shell脚本之if判断以及case多分支选择
    shell脚本之数组
    shell脚本之变量
    nginx常用内置变量
    nignx配置文件详解
    nginx源码安装./configure常见参数详解
  • 原文地址:https://www.cnblogs.com/wengyuli/p/1918109.html
Copyright © 2011-2022 走看看