簡體   English   中英

IIS ServicePoint ConnectionLimit始終設置為Int32.MaxValue

[英]IIS ServicePoint ConnectionLimit always set to Int32.MaxValue

我有一個在IIS上運行的本地Web應用程序,該應用程序與AWS上部署的服務聯系。

在針對AWS服務測試吞吐量時,我意識到我的本地Web應用程序不遵循通過以下代碼在web.config中設置的ConnectionLimit值:

<system.net>
  <connectionManagement>
    <add address="*" maxconnection="48" />
  </connectionManagement>
</system.net>

相反,以下代碼始終返回int.MaxValue

@(ServicePointManager.FindServicePoint(new Uri("https://myawsservice/")).ConnectionLimit)

這似乎與我在這里閱讀的內容相矛盾: http : //msdn.microsoft.com/zh-cn/library/ms998583.aspx#scalenetchapt17_topic14

maxconnection的增加使更多調用可以同時執行到遠程Web服務。 此屬性不會影響本地Web服務調用。 並發調用數量的增加導致用於進行遠程調用的線程的利用率增加。

我希望Int32.MaxValue僅適用於本地Web服務。 我不認為我的AWS服務是本地的。

我錯過了什么? 我是否誤解了本地Web服務的定義?

在此先感謝您的幫助。 尼科

找到了問題。

如果在machine.config中將processModel autoConfig屬性設置為“ true”,則無法使用web.config覆蓋ConnectionLimit

  <system.web>
    <processModel autoConfig="true" />
    ...
  </system.web>

如果要控制ConnectionLimit,請將其設置為“ false”,但在這種情況下,您可能需要查看autoConfig啟用時設置的其他值。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM