views:

2920

answers:

2

I intermittently get the following exception in my .Net WCF Service. "The HTTP service located at http://MyServer/TestWCF/MyService.svc is too busy."

Am I missing something here?

Am using basic http binding and have enabled WCF throttling.

<basicHttpBinding>
        <binding name="BasicHttpBinding_MyService" maxReceivedMessageSize="2147483647"
                 messageEncoding="Text" textEncoding="utf-16" sendTimeout="00:01:00" >
          <readerQuotas maxStringContentLength="2147483647" maxArrayLength="163840000"
                        maxDepth="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="16384" />
        </binding>

. . . .

<behavior name="MyWCFServices.MyServiceBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceThrottling
                    maxConcurrentCalls="16"
                    maxConcurrentInstances="2147483647"
                    maxConcurrentSessions="10"/>
        </behavior>

Will throttling help resolving the issue? Also,may i know the recommended parameter values for throttling for a high traffic web site?

Thanks for reading.

+1  A: 

You could definitely try to increase the maxConcurrentSessions and maxConcurrentCalls in your service throttling behavior to the standard values of 30 or so and see if that makes the error go away. Server too busy would seem to indicate that more requests have come in than area allowed by your service throttling behavior, and they've been discarded since no service instance became available to service them within the given timeout period.

Marc

marc_s
thanks for ur answer...do i need to enable throttling both at the client and server side web.configs?
Steve Chapman
also,i would like to know what is the recommended value for maxConcurrentInstances parameter?
Steve Chapman
Hi Steve - no need to handle this on the client - this is a server side only setting. As for maxConcurrentInstances: ask yourself how many requests from clients you want to handle simultaneously. 5? 10? How long does it take to handle the request? A good starting point might be 30 and see if a) this helps your service be more responsive, and b) doesn't overload your server. Tweak as needed after you see how it behaves.
marc_s
A: 

It is not just the maxConcurrentSessions, it is also how long the session lasts.

If the client does not close the connection, it will remain open until it timesout. You could then hit the maxConcurrentSessions limit with very little activity on the server.

The easiest way to do this is to use the using statement, when creating the WCF reference on the client side.

Shiraz Bhaiji