views:

596

answers:

2

I am trying to set up a service and I keep getting the following error

The HTTP service located at http://localhost/Service1.svc is too busy.

Its very annoying problem that I wish I could fix.

I am not overloading the system but I am using Threads in my program. Maybe I should disable them? no?

I am using an old computer running Server 2003. My laptop is a dual processor so I runs no problem there. Anyone have any experience in dealing with this?

A: 

How are you using threads. If you're using them the wrong way, they could easily be getting in their own way.

The naive way to use threads is to just kick off a new thread on every request with new Thread().Start. That will kill your performance, and will be of no value.

Consider that only one thread can run at a time on your single-core computer. Even if most are blocked, anything more than about 20 threads is going to be too much.

John Saunders
A: 

I am assuming you are using threads in your client application, and each thread is calling the WCF service? You might be running into and issue due to one of the default max concurrency settings. WCF allows you to configure the maximum number of connections, sessions, calls, etc. (depends on the binding.) Check your binding configuration, and make sure you are allowing for the concurrency you require.

For example, the netTcpBinding has both a maxConnections setting as well as a listenBacklog setting. The listenBacklog allows you to configure the maximum number of channels that can be waiting on the listener, beyond the maxConnections, that the service host will allow before spitting out a message like "The HTTP service located at http://localhost/Service1.svc is too busy."

jrista