如何配置IIS Express中允许的最大请求数量?
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.
推荐答案可以使用applicationHost.config文件配置IIS Express. 它位于%userprofile%\my documents\IISexpress\config
IIS Express can be configured using applicationHost.config file. It is located at %userprofile%\my documents\IISexpress\config
在文本编辑器中打开此文件.您将在<system.applicationHost>部分中找到<sites>元素.这样,您将为IIS Express上托管的每个站点找到一个<site>元素.查找与您的站点相对应的元素.如下所示添加<limits>元素.
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>您可以将maxConnections参数设置为所需的请求数.
You can set maxConnections parameter to desired number of requests.
尽管我没有测试过,但它应该可以工作.
This should work though I have not tested it.
更多推荐
在IIS Express中配置最大请求数
发布评论