Configure Maximum Number of Requests in IIS Expres

2019-04-09 02:40发布

问题:

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.

回答1:

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.



回答2:

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



标签: iis-express