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>

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

 

转载自:https://www.cnblogs.com/wengyuli/archive/2010/12/27/1918109.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值