5

How can I configure the maximum number of requests allowed in IIS Express?

I would like to change this to only allow a few requests to test what happens when it exceeds the limit.

Dismissile
  • 32,564
  • 38
  • 174
  • 263

2 Answers2

6

IIS Express can be configured using applicationHost.config file. It is located at %userprofile%\my documents\IISexpress\config

Open this file in text editor. You will find <sites> element in <system.applicationHost> section. In that you will find a <site> element for each site hosted on IIS express. Find the element corresponding to your site. Add a <limits> element as shown below.

<sites>
  <!-- Other sites -->

  <site name="YourSiteName" id="YourSiteId">
    <!-- Existing elements -->

    <limits maxBandwidth="65536" maxConnections="1024" connectionTimeout="00:01:00" />
  </site>

  <!-- Remaining sites -->
</site>

You can set maxConnections parameter to desired number of requests.

This should work though I have not tested it.

Kedar Vaidya
  • 678
  • 1
  • 7
  • 14
  • 3
    Is it just me or do these values under the limits element seem to be completely ignored by IIS Express? I'm not sure if that holds true for maxConnections and maxBandwidth but it has been my experience that connectionTimeout isn't obeyed at all when using IIS Express. http://stackoverflow.com/a/14349049/83658 – jpierson Jan 16 '13 at 05:11
  • That was my experience as well. Does anyone know if MS intends to fix this problem with IIS Express? – petrsnd Sep 20 '13 at 22:51
  • They appear to be ignored, or at least values > 1 are ignored as `maxBandwidth="10"` still gives me >1MB per sec during testing. – Reahreic May 30 '23 at 17:06
0

Now this is a tough question to answer. The number of requests the server can handle depends on the Server, the CPU and the RAM on which it has been hosted. By default, IIS supports unlimited connections. However, you can perform stress testing to see how much load can that server take. Later use a load balancer to pass on the excessive load to another IIS server.

You can always do request filtering in IIS . See this

Anil
  • 967
  • 10
  • 20
  • 1
    I'm confused? I thought you could limit the number of requests that IIS would accept. If the number of requests that the server has exceeds the limit they would see a HTTP 503 - Server Too Busy message. – Dismissile Jan 04 '12 at 18:13
  • IIS on client operating systems such as Windows 7 / 8 / 10 AREN'T unlimited due to licensing. You said 'server' here so yes on a server there is no such limit, but just wanted to make sure others were aware of the limits. – Simon_Weaver Oct 13 '15 at 07:31