zoukankan      html  css  js  c++  java
  • <转>WCF实例化模式与高并发处理

    WCF实例化模式与高并发控制

    1.实例化模式InstanceModel

    1.1 PerCall:单调模式

        每次调用都会产生一个实例

        例[ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall)]

    1.2 PerSession会话模式   

        每次调用都有同一个服务进行处理

        [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerSession)]

    1.3 SingleTon 单例模式    

        多个请求,只有一个实例

        [ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)]

    2.并发控制

    在服务行为里设置

    <serviceThrottling

       maxConcurrentCalls="1000"         //最大并发请求消息数量

       maxConcurrentInstances="1000"     //最大并发服务实例的数量

       maxConcurrentSessions="1000" />   //最大并发会话连接数

    <behaviors>
      <serviceBehaviors>
          <behavior name="WCFService.WCFServiceBehavior">
             <serviceMetadata httpGetEnabled="false"/>
             <serviceDebug includeEXceptionDetilInfaults="false"/>
             <serviceThrottling maxConcurrentCalls="200" maxConcurrentSessins="100" maxConcurrentInstances="1000"/>
          </behavior>
      </serviceBehaviors>
    </behaviors>
    View Code
  • 相关阅读:
    广义表的创建和遍历
    dev c++ Boost库的安装
    NAT模式
    vmware桥接模式
    smb与samba
    利用Linux的Samba服务模拟NT域
    使用samba进行共享文件操作步骤
    安装chrome
    使用虚拟机上网第二步
    TCP协议三次握手过程分析
  • 原文地址:https://www.cnblogs.com/chcong/p/4243172.html
Copyright © 2011-2022 走看看