简体   繁体   English

缓存的Web服务客户端上的WCF方法调用是否被视为新的IIS7连接?

[英]An WCF method call on a cached web service client is considered a new IIS7 connection?

The scenario is: There is a WCF Web Service on a Windows 7 computer, with IIS7. 方案是:Windows 7计算机上具有IIS7的WCF Web服务。 For IIS7 with Windows 7 only 10 connection can be made (as I found out from the Internet). 对于带有Windows 7的IIS7,只能建立10个连接(从Internet上可以找到)。

This WCF Web Service has a cached service client connection to another WCF Web Service. 此WCF Web服务具有与另一个WCF Web服务的缓存的服务客户端连接。 Is that one cached service client one of the 10 connections (limited by IIS7)? 那一个缓存的服务客户端是10个连接之一(受IIS7限制)吗? Or each method call throught that cached connection will be one of the 10 connections? 还是通过缓存连接将是10个连接之一的每个方法调用?

Note: Thought I have accepted my answer, I am interested on better answers and if they really address the general context of the question (because it's more of a theoretical one) I am going to mark them as a answer (instead of mine). 注意:以为我已经接受了我的答案,我对更好的答案很感兴趣,如果它们真的能解决问题的一般背景(因为它更多是一种理论上的问题),我将把它们标记为答案(而不是我的答案)。

After some documentation and tests, as no good answer was provided, I managed to found out this: 经过一些文档和测试,由于没有提供好的答案,我设法找到了这一点:

The 10 connection limit is for HTTP requests. 10个连接限制适用于HTTP请求。 Each method call from another WCF service needs 2 HTTP requests (this is the way WCF services communicate). 来自另一个WCF服务的每个方法调用都需要2个HTTP请求(这是WCF服务进行通信的方式)。 May be different thought if the settings of the binding and authentication differs. 如果绑定和身份验证的设置不同,可能会有所不同。 I didn't find any information that caching the web service client may help. 我没有找到任何信息可以缓存Web服务客户端。

The other HTTP requests (more than 10) aren't refused, they are actually cached in IIS. 其他HTTP请求(超过10个)不会被拒绝,它们实际上是缓存在IIS中。

So the short answer would be a method call is one of the 2 out of 10 HTTP requests. 因此,简短的答案是方法调用是10个HTTP请求中的2个之一。

Some links: http://www.jpelectron.com/sample/WWW%20and%20HTML/IIS-%20OS%20Version%20Limits.htm https://www.owasp.org/index.php/Authentication_In_IIS http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/fe1772c8-9ae3-4f6b-b05f-d9eeb683b623/ 有些链接: http://www.jpelectron.com/sample/WWW%20and%20HTML/IIS-%20OS%20Version%20Limits.htm https://www.owasp.org/index.php/Authentication_In_IIS HTTP:// social.msdn.microsoft.com/Forums/zh-CN/wcf/thread/fe1772c8-9ae3-4f6b-b05f-d9eeb683b623/

Note: Thought I have accepted my answer, I am interested in more information and a better answer to this question. 注意:以为我已经接受了我的答案,我对更多信息以及对该问题的更好答案感兴趣。

If your application is built on .Net Framework 3.5 (not .Net Framework 4.0), then I guess that the limit you're hitting is <serviceThrottling> limit which has following default value, 如果您的应用程序是基于.Net Framework 3.5(而不是.Net Framework 4.0)构建的,那么我想您要达到的限制是<serviceThrottling>限制,该限制具有以下默认值,

maxConcurrentSessions - 10
MaxConcurrentCalls - 16
maxConcurrentInstances - 16

So, if your binding configuration has Security or Reliable sessions ON and there are 10 concurrent users (users = Service proxy instance in open state) than maxConcurrentSessions limit is reached and requests to create new session (new Service proxy Open) will be queued, until old proxy connections are closed. 因此,如果您的绑定配置启用了“安全”或“可靠”会话,并且有10个并发用户(用户=服务代理实例处于打开状态),则超出了maxConcurrentSessions的限制,并且将创建新会话(新服务代理“打开”)的请求排队,直到旧的代理连接已关闭。 You can try adding following configuration in both Front-end WCF service and Backend WCF service, and check if it helps. 您可以尝试在前端WCF服务和后端WCF服务中添加以下配置,并检查是否有帮助。

<behaviors> 
  <serviceBehaviors> 
    <behavior name="CalculatorServiceBehavior"> 
      <serviceDebug includeExceptionDetailInFaults="False" /> 
      <serviceMetadata httpGetEnabled="True"/> 
      <!-- Specify throttling behavior -->
      <serviceThrottling maxConcurrentCalls="30" 
           maxConcurrentSessions="30" /> 
           maxConcurrentInstances="30" /> 
    </behavior>
  </serviceBehaviors>
</behaviors>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM