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

SSRS 2019大负载HTTP响应失败 如何突破EntityChunkCount 9999限制?

SSRS大体积XLSX报表HTTP响应阶段块数超限问题

根据2012年发布的StackOverflow相关问题记载,SSRS所使用的Win32 API HTTP服务端函数HttpSendResponseEntityBody()存在硬编码限制:EntityChunkCount参数上限为9999,该值为指向HTTP_DATA_CHUNK结构的指针数组的最大容量。

故障背景

  • 故障排查过程中发现,体积约500MB的报表可成功完成渲染,但在HTTP响应返回阶段触发失败
  • 该故障涉及一个已稳定运行多年的核心XLSX报表渲染请求,面向部分体量较大的客户生成报表时,开始出现SSRS HTTP响应失败的问题
  • 目前已将web.config中所有客户端最大响应大小、请求超时参数,以及ReportingService的最大HTTP长度、超时配置项均设置为极高数值,仍无法解决故障
  • 当前测试环境为SSRS 2019,本次咨询不关注该限制是否已在新版本修复,核心诉求为确认是否存在web.config、.NET框架配置之外的机器级配置(例如注册表项),可通过修改提升该数据块数量上限

核心报错信息:BaseWorkerRequest::SendHttpResponse(bool), exception=System.ArgumentException: Value does not fall within the expected range

复现步骤

  1. 封装ReportExecution2005服务,调用指定报表的Render()方法,本次测试设置超时时间为10小时,渲染格式为xlsx。核心调用代码如下:
ReportRenderResponse result = new ReportRenderResponse();

ReportExecutionService _execService = new ReportExecution.ReportExecutionService { Timeout = request.ReportTimeout };
_execService.Url = request.ServiceUrl;
_execService.Credentials = request.Credentials;

ParameterValue[] ssrsParams = request.Parameters.Parameters.ToSSRSParameters();

StringBuilder deviceInfo = CreateDeviceInfoForRender(request);

string extension;
string mimeType;
string reportEncoding;
string[] streamIDs = null;
Warning[] warnings = null;
ExecutionInfo reportInfo = _execService.LoadReport(request.ReportPath, null);

if (ssrsParams != null)
    _execService.SetExecutionParameters(ssrsParams, request.ParameterLanguage);

_execService.ExecutionHeaderValue = new ExecutionHeader();
_execService.ExecutionHeaderValue.ExecutionID = reportInfo.ExecutionID;

result.Payload = _execService.Render(request.Format.ToSSRSRenderExtension(), deviceInfo.ToString(), out extension, out mimeType, out reportEncoding, out warnings, out streamIDs);
  1. 构造数据集,发起对应类别的Render请求,测试统计数据如下:
TimeDataRetrieval(数据检索耗时)TimeProcessing(处理耗时)TimeRendering(渲染耗时)Source(数据源)Status(状态)ByteCount(字节数)RowCount(行数)
28327811235015404015Live(生产环境)rsSuccess4422388383446298
29367910861775333539LiversSuccess4422388383446298
37301110830595268298LiversSuccess4422388383446298
2861519559295068241LiversSuccess4422388383446298
32093610971875191568LiversSuccess4422388383446298
33483910387224778627LiversSuccess4422388383446298
  1. 查看ReportService日志,可获取如下错误日志:

rshost!rshost!340c!07/13/2022-11:47:12:: e ERROR:
HttpPipelineCallback::SendResponse(): failed writing response.
rshost!rshost!340c!07/13/2022-11:47:12:: e ERROR: Failed with win32
error 0x0057, pipeline=0x0000016EC8CA7D60.
httpruntime!ReportServer_0-4!340c!07/13/2022-11:47:12:: e ERROR:
Failed in BaseWorkerRequest::SendHttpResponse(bool),
exception=System.ArgumentException: Value does not fall within the
expected range. at
Microsoft.ReportingServices.HostingInterfaces.IRsHttpPipeline.SendResponse(Void*
response, Boolean finalWrite, Boolean closeConn) at
ReportingServicesHttpRuntime.BaseWorkerRequest.SendHttpResponse(Boolean
finalFlush)


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.26 13:45:36