You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

.Net应用与IIS服务器通信异常问题排查求助

高并发下.NET客户端调用IIS服务抛出Task Cancelled错误排查求助

问题概述

正常状态下无异常,但高并发繁忙时段,基于.NET开发的自定义客户端向IIS服务器发送POST/GET请求时,会因未收到响应抛出Task Cancelled错误,且Web服务器完全没有收到对应请求的日志。

环境信息

  • 客户端/服务器系统:Windows Server 2016
  • 客户端:自定义.NET应用,单台客户端运行5个实例,应用最大并发数设置为40,客户端套接字上限1000
  • 服务器:IIS
  • 中间路由防火墙:Palo Altos
  • 生产环境流量全加密

已做排查

  • 网络抓包(客户端、服务器、防火墙):仅发现TCP-FIN(预期行为)和TCP-RESET-FROM-SERVER(IIS默认2分钟超时断开),无其他明显异常;因流量加密无法追踪单个请求
  • 套接字排查:通过netstat查看,错误发生时套接数(含TIME_WAIT)不超过20,远低于设置的并发上限40,暂未发现耗尽迹象
  • 性能排查:出现问题时所有节点硬件资源未达上限

具体错误日志

[Error] [appstuff.Httpclient] RequestID: XXXX communication with web service invocation, exception on invoke with request type Post and request uri apistuff
system.aggregate.exception: one or more errors occured ---> system.threading.tasks.task.canceled.exception. a task was cancelled
---end of inner exception stack trace----
at system.threading.tasks.task1.GetResultCore(boolean waitCompelteNotification)
at appstuff.httpclient.invoke(http request type, string requesturi, object request parameter, string authentication)  in appstuff.httpclient.cs:line 200
----->inner exception #0 system.threading.tasks.taskcenceledexception: a task was cancelled <----

当前分析与求助

  • 客户端本应在高并发时段复用连接,但目前怀疑请求可能并未实际发送到网络,导致任务因超时而被取消
  • 已排查网络、套接字、性能层面,暂无线索,请求协助定位问题方向或分享类似排查经验

内容的提问来源于stack exchange,提问作者Frankie

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.22 14:18:17