技术开发 频道

化零为整WCF - 限流(Concurrent和Throttle)


【IT168技术文档】

  WCF(Windows Communication Foundation) - 限流(Throttle):
<behaviors> <serviceBehaviors> <behavior name="BehaviorPerCall"> <!--httpGetEnabled - 指示是否发布服务元数据以便使用 HTTP/GET 请求进行检索,如果发布 WSDL,则为 true,否则为 false,默认值为 false--> <serviceMetadata httpGetEnabled="true"/> <!--maxConcurrentCalls - 服务中同时存在的最大活动消息数,默认值为 16--> <!--maxConcurrentInstances - 服务中同时存在的最大服务实例数,默认值为 Int32.MaxValue--> <!--maxConcurrentSessions - 服务中同时存在的最大会话数,默认值为 10--> <serviceThrottling maxConcurrentCalls="" maxConcurrentInstances="" maxConcurrentSessions="" /> </behavior> <behavior name="BehaviorPerSession"> <serviceMetadata httpGetEnabled="true"/> <serviceThrottling maxConcurrentCalls="" maxConcurrentInstances="" maxConcurrentSessions="" /> </behavior> <behavior name="BehaviorSingle"> <serviceMetadata httpGetEnabled="true"/> <serviceThrottling maxConcurrentCalls="" maxConcurrentInstances="1" maxConcurrentSessions="" /> </behavior> </serviceBehaviors> </behaviors>
0
相关文章