在IIS Express中配置最大请求数 [英] Configure Maximum Number of Requests in IIS Express

查看:50
本文介绍了在IIS Express中配置最大请求数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何配置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中配置最大请求数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆