0

I have a .NET 3.5 BasicHttpBinding no security WCF service hosted on IIS 6.0.

I have service throttling bumped up as per MS recommendations.

My service operation is getting called a few hundreds of time conccurrently, and at some point the client gets a timeout exception (59:00, that's whats set in the server and client timeouts).

If I raise the timeout it just hits the new limit.

It seems like the application just "freezes" somewhere and we have not been able to figure out how this happens.

WCF tracing on the server side doesn't come up with anything.

Any ideas regarding what could be the issue?

Thanks

user1477327
  • 144
  • 8
  • Timeouts in WCF can be indicative of a problem in the service (usually an unhandled exception of some sort). You mention this is being hosted in IIS - do you know if the client's are closing their channels when they're done? If they're not, this could be the source of the problem as well, as you can run into resource constraints with clients that are left to "die a natural death", so to speak. – Tim Jun 25 '13 at 05:36
  • You mention hundreds of concurrent requests, but does it work for a single request? Also please check the event logs on the server, it might have a system error or something. – Anu Jun 25 '13 at 05:53
  • Are you correctly closing your channels? We had a similar issue and found out that some operations on the client side didn´t close their `IClientChannel`, resulting in a lot of open channels, which eventuelly stopped the server from accepting new connections. – Jobo Jun 25 '13 at 06:13
  • We are closing our channels. we are instantiating a new generated proxy for every call and then call .Close() on it. by the way, is .Close() required even for basicHttpBinding? – user1477327 Jun 25 '13 at 09:14

1 Answers1

0

I assume your WebService is not using the new async/await especially wrt the database calls. In that case its because you are blocking your limited threads.

In more detail. IIS/ASP.net only creates a limited number of threads to handle requests. The first...say 8 requests spin up threads and start working. At some point they will hit the database (I am assuming a traditional n-tier app). Those threads sleep. The next say...992 requests hit IIS and are held in a queue.

At some point the database calls return, process stuff...send data to the client. Another 8 requests are dequeued...hit the database...etc...

However each set of 8 requests takes a finite time to complete. With over 900 requests ahead of them, the last 100 or so threads will take at the very least 100 * latency * number of roundtrips before they can start up. If your latency * number of roundtrips is high...your last request will take a long time before it even gets dequeued, hence the timeout.

Two remedies exists. The first, create more threads....will use up all your memory and your IIS crashes. The second is to use .net 4.5 and async/await.

See here for more information

Community
  • 1
  • 1
Aron
  • 15,464
  • 3
  • 31
  • 64