Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS and HTTP pipelining, processing requests in parallel

Tags:

http

iis-7

Is it possible to configure IIS in such a way that it can handle multiple HTTP requests that arrive on the same TCP socket in HTTP pipelining mode in parallel?

We have a problem where multiple requests are done by a web client in a single TCP socket, using HTTP pipelining. The client basically sends let's say 10 requests at once, and then the server sends 10 responses (in the same order as the requests). Our server takes quite some time for each request, mostly waiting for external IO. It would be much more efficient if IIS could start to work on all 10 requests in parallel, then serialize the responses in the correct order back to the client. Obviously, the server would need some way to cache responses if e.g. response 3 is available earlier than response 2.

Is that possible somehow? Maybe this is not possible in IIS, or I'm just searching for the wrong keywords... We are running IIS 7.5 and ASP.NET 4.5 on Windows Server 2008 R2.

like image 830
chris166 Avatar asked Aug 25 '26 09:08

chris166


1 Answers

We came across the same issue in IIS 7.5.

Our solution was to enable "Web Garden"... and it really really works well! It's just that you can't have a "session" based web site. So if you have clients "logging in", you will have to re-configure the process. (We used cookies to store an encrypted token - anyway that's besides the point).

Go to:

  1. Internet Information Service > Applications Pools
  2. Select the Pool being used (you should have a pool per site)
  3. Click Advanced Settings...
  4. Find "Maximum Worker Processes" and crank that sucker!

The amount of processes that you push it up to now depends entirely on how much RAM your system has. You can of course monitor and control this your self.

With a "Web Garden" enabled, you will notice (with Process Explorer or something similar), IIS will spawn a new instance of w3wp.exe for each request, up to the max number you specified. New requests simply get processed by the next available Worker Process available, enabling true IIS parallel request processing. If two requests come in within moments of each other, and request 2 is completed before request 1, request 2 is sends its response.

like image 95
Conrad de Wet Avatar answered Aug 26 '26 23:08

Conrad de Wet