解决WCF接口超时无响应 最大连接数问题

本文介绍了如何通过调整WCF服务的行为配置来提高其并发处理能力,包括设置最大并发调用、实例和会话的数量,以减少因长时间操作导致的新请求超时问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

如果WCF接口代码操作时间比较费时,那么当连接数占满时,新的请求将会返回超时错误,请参考以下代码,加在wcf host主机配置文件内

<serviceBehaviors>
<!--

maxConcurrentCalls - 服务中同时存在的最大活动消息数,默认值为 16
maxConcurrentInstances - 服务中同时存在的InstanceContext的最大数量,默认值为26

maxConcurrentSessions - 服务中同时存在的最大会话数,默认值为 10


 -->

 
    <behavior name="h.SOA.E**.Service1Behavior">
                                       <serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="1000" maxConcurrentInstances="50000" />
     <serviceMetadata httpGetEnabled="true"/>
     <serviceDebug includeExceptionDetailInFaults="false"/>


    </behavior>
    <behavior name="h.SOA.E**.EsalesServiceBehavior">


                                         <serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="1000" maxConcurrentInstances="50000" />
     <serviceMetadata httpGetEnabled="true"/>
     <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
   </serviceBehaviors>

转载于:https://www.cnblogs.com/wfwup/archive/2010/11/11/1875048.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值