Question

I have a simple .NET 4.5 HttpHandler that does not seem to scale beyond 10 concurrent requests. I'm expecting a much higher figure. The handler does nothing more than sleep for a second and return a simple string.

concurrent requests   requests/minute
1                     60
8                     480
9                     540
10                    600
11                    600
12                    600
15                    600
32                    600
512                   600

I've got a 64-bit Win7 machine with a 4-core i7 with 32GB of ram and an SSD, and the machine is idle during all the tests. IIS is as configured out of the box. I've also tried running this with an app pool created by IISTuner from Codeplex, but with no change in result.

Changing IsReusable between true/false does nothing.

I've added an entry to web.config to disable session state. I'm using SoapUI for the testing, and have the close connections after each request flag set (and can see this reflected in the http headers). Again, nothing seems to change.

Amending the number of processes per app pool does raise the number, but still gives nowhere near the throughput I'm expecting (hundreds/thousands of concurrent requests).

Here is the handler:

class TestHandler : IHttpHandler
{
    public void ProcessRequest(HttpContext context)
    {
        Thread.Sleep(1000);
        context.Response.Write("I slept for 1s");
    }

    public bool IsReusable { get { return true; } }
}

Here is the associated web.config file:

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <sessionState mode="Off" timeout ="20" cookieless="false"></sessionState>
  </system.web>

  <system.webServer>
    <handlers>
      <add name="Proposal01_Test" verb="*"
        path="*.test"
        type="Proposal01.TestHandler, Proposal01"
        resourceType="Unspecified" />
    </handlers>
  </system.webServer>

</configuration>

What am I missing?

Was it helpful?

Solution

The problem is as @Damien states - thank you again - this is a non-server OS limitation in Win7/IIS7.5, which I never picked up on as we've had Java services on the same machine scale into the thousands of concurrent request territory. Yey MS.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top