30

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?

johnnyRose
  • 7,310
  • 17
  • 40
  • 61
Steve Chapman
  • 1,317
  • 4
  • 23
  • 34

8 Answers8

10

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.

johnnyRose
  • 7,310
  • 17
  • 40
  • 61
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • thanks for ur answer...do i need to enable throttling both at the client and server side web.configs? – Steve Chapman May 25 '09 at 22:29
  • also,i would like to know what is the recommended value for maxConcurrentInstances parameter? – Steve Chapman May 25 '09 at 22:33
  • 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 May 26 '09 at 05:03
  • Yeah... Check it here as well http://msdn.microsoft.com/en-us/library/system.servicemodel.description.servicethrottlingbehavior.maxconcurrentsessions.aspx – NoWar Dec 13 '11 at 15:04
9

My answer would be, check if the app pool is up and well?

I've seen this error occurring when the app pool has died due to exceptions being thrown that aren't caught.

Consider for example, custom config sections - having an error in there, will cause your app to fail before it's even started. Too many of these in a short space of time will kill the app pool.

Adam C.
  • 91
  • 1
  • 1
  • Check this first. It may "look" ok, but if you Stop the app pool from the manager, you will be unable to re-start it. To get everything going again, use "net stop w3svc" then "net start w3svc" from the command line. – tofutim Jan 19 '12 at 17:11
  • Thank you for saving my sanity that was just on its way out the door. – eouw0o83hf Apr 06 '12 at 14:19
  • This did it for me guys! Recycled the app pools and bingo – JeremyS Apr 29 '13 at 07:53
4

If you're service is running under your account (Identity), it's quite possible that you've recently changed your password--you'll need to reset it for its IIS application pool in Advanced Settings | Identity dialog box.

  • 1
    +1 This just happened in a production environment. Very misleading error message indicating server busy. Boo. Thanks for pointing this out! – Jerry Bullard May 12 '12 at 02:24
2

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.

Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252
  • 2
    Actually, the client should not use the using statement. Clean up should be handled explicitly. See http://msdn.microsoft.com/en-us/library/aa355056.aspx for more details. – Ant Swift Apr 13 '11 at 09:32
  • @Anthony, thanks for the comment, I have removed the using part. This was from 2009, when I was younger and didn't know any better :) – Shiraz Bhaiji Apr 13 '11 at 12:01
  • 1
    @AntSwift: Many people know it but don't do this though. – abatishchev May 28 '12 at 13:17
2

Make sure you check the inner exception, too; during our deployments, we disable the application pool of a WCF web service, and clients start getting this error during that time:

System.ServiceModel.ServerTooBusyException: The HTTP service located at https://ourserver.x.com/path/service.svc is too busy. ---> System.Net.WebException: The remote server returned an error: (503) Server Unavailable.

So in this case an HTTP error 503 is being (mis?)interpreted as "server too busy".

ALEXintlsos
  • 1,809
  • 4
  • 17
  • 17
1

I just ran into this error, and it boiled down to a simple configuration problem. I had a service up on the exact same port and same interface (mock service). I ran the service with the appropriate command line switch to run the "original" service I intended. The error went away.

Arturo Hernandez
  • 2,749
  • 3
  • 28
  • 36
1

My Solution would be, Check the App.Config file, whether the service tag is there for this particular service.

eg:

<service name="MyServices.ServiceName">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="TestBinding"   contract="MyServices.ServiceName">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8732/Design_Time_Addresses/MyServices/ServiceName/" />
          </baseAddresses>
        </host>
</service>
Arun Kumar T
  • 620
  • 4
  • 12
  • 26
1

The only source of this exception that I am aware of is if you are using sessions, and you manage to hit the MaxPendingChannels throttle,. Its default is something pretty low like 4. You could try setting it higher (128 for example), or if you just want to repro, set it to 1 and you should see it under load testing.

See here for more information about sessions: http://msdn.microsoft.com/en-us/library/ms733795.aspx

krisragh MSFT
  • 1,908
  • 1
  • 13
  • 22