简体   繁体   中英

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. For IIS7 with Windows 7 only 10 connection can be made (as I found out from the Internet).

This WCF Web Service has a cached service client connection to another WCF Web Service. Is that one cached service client one of the 10 connections (limited by IIS7)? Or each method call throught that cached connection will be one of the 10 connections?

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. Each method call from another WCF service needs 2 HTTP requests (this is the way WCF services communicate). 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.

The other HTTP requests (more than 10) aren't refused, they are actually cached in IIS.

So the short answer would be a method call is one of the 2 out of 10 HTTP requests.

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/

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,

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. You can try adding following configuration in both Front-end WCF service and Backend WCF service, and check if it helps.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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