wcf出站http请求排队问题排查,connectionManagement配置最大连接数

itlao6 .NET 原创 开发&源码评论549字数 504阅读1分40秒阅读模式

问题排查:

最近公司一套老版本的公众号站点出现卡顿问题,经过排查,发现wcf中调用http请求超时;经过设置代理转发并查看nginx日志后,排除第三方的延时问题,确认是在我们请求wcf时产生了排队现象; 文章源自IT老刘-https://itlao6.com/8665.html

问题原因: 文章源自IT老刘-https://itlao6.com/8665.html

在默认情况下,nginx出站http请求最大连接数是2(没错,当时我也感觉很惊讶,wcf好几百的并发量,最大连接数是2居然一直都没出问题),其实是因为之前第三方http返回都很快,0.01 ~ 0.1s左右就能正常返回,所以用户端没感觉到很卡;现在却因为一个接口偶现3 ~ 4s的延时,导致整个wcf连接第三方站点出现超时。 文章源自IT老刘-https://itlao6.com/8665.html

问题解决: 文章源自IT老刘-https://itlao6.com/8665.html

于是,在config中增加了以下配置 ,问题得到解决文章源自IT老刘-https://itlao6.com/8665.html

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

注意:文章源自IT老刘-https://itlao6.com/8665.html

  • 1.maxconnection的值根据服务器性能及业务需求而定。
  • 2.该配置不能建议配置在config文件configuration节点中的最后位置,如果放在第一个,会出现wcf或者站点无法正常启动的问题。
文章源自IT老刘-https://itlao6.com/8665.html文章源自IT老刘-https://itlao6.com/8665.html
weinxin
我的微信公众号
微信扫一扫关注公众号,不定时更新
itlao6
  • 本文由 发表于 2022年 5月 24日 23:16:00
  • 转载请务必保留本文链接:https://itlao6.com/8665.html
评论  0  访客  0
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定