2
votes

I am debugging an ASMX web service that receives "bursts" of requests. i.e., it is likely that the web service will receive 100 asynchronous requests within about 1 or 2 seconds. Each request seems to take about a second to process (this is expected and I'm OK with this performance). What is important however, is that each request is dealt with sequentially and no parallel processing takes places. I do not want any concurrent request processing due to the external components called by the web service. Is there any way I can force the web service to only handle each response sequentially?

I have seen the maxconnection attribute in the machine.config but this seems to only work for outbound connections, where as I wish to throttle the incoming connections.

Please note that refactoring into WCF is not an option at this point in time.

We are usinng IIS6 on Win2003.

3
@Alex: Did any of these answers help you? You should upvote the ones that helped, so people reading this question later will know which are the helpful answers. - John Saunders
Not really. I am looking for details on how IIS6 behaves (or can be forced to behave) in this scenario. Programmatic solutions are no good to me in this case, and I can not upgrade to IIS 7. - Alex
IIS has nothing to do with the problem. It is not involved except to pass the requests to ASP.NET. - John Saunders
So, given that changing the behavior of IIS6 cannot solve your problem, is is possible that one of these answers will solve your problem? - John Saunders

3 Answers

1
votes

What I've done in the past is to simply put a lock statement around any access to the external resource I was using. In my case, it was a piece of unmanaged code that claimed to be thread-safe, but which in fact would trash the C runtime library heap if accessed from more than one thread at a time.

0
votes

Perhaps you should be queuing the requests up internally and processing them one by one?

It may cause the clients to poll for results (if they even need them), but you'd get the sequential pipeline you wanted...

0
votes

In IIS7 you can set up a limit of connections allowed to a web site. Can you use IIS7?