gpt4 book ai didi

wcf - 为什么我的客户发送请求如此缓慢?

转载 作者:行者123 更新时间:2023-12-02 04:18:09 27 4
gpt4 key购买 nike

我有WCF客户端向服务发送请求。我的业务代码调用客户端API,以每秒发送300多个请求。但是根据我的服务和WCF ServicePoint的性能计数器,我的客户端仅向服务发送约50个服务。

而且我在代码中将ServicePointManager.DefaultConnectionLimit增加到1000,并且在服务配置文件中将maxConCurrentCalls设置为1000,但是没有什么改善。

我猜想WCF客户端中可能有队列等待发送请求。有什么方法可以配置它并加速我的客户端。

这是我的客户端配置:

<basicHttpBinding>
<binding name="Binding" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2000000" maxBufferPoolSize="524288" maxReceivedMessageSize="2000000"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>

最佳答案

您可能会因为出去的HTTP连接而达到连接限制:

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

请注意默认值为2。

关于wcf - 为什么我的客户发送请求如此缓慢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1421255/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com