【问题标题】:the request has exceeded the allowable time limit tag: cfoutput请求已超过允许的时间限制标签:cfoutput
【发布时间】:2016-01-12 00:11:32
【问题描述】:

我有一份大报告。 SQL 只需要大约 60 秒的时间来运行,但 PDF 的实际呈现是一直占用的。它有数百页。

请求超时的全局设置设置为 240 秒。

我将覆盖此报告的全局设置并将值设置为任意高(3600 秒)。实际上,这份报告的完成时间不会超过 15 分钟。

无论我将超时设置多高,此页面都会在超时之前产生时间限制错误。

SQL 可能需要 24 秒到 4 分钟才能完成,具体取决于选择的区域数量。

即使我覆盖了超时,页面在完成查询后大约 170 秒(只有一个数据点)会产生错误。因此,有时甚至在全局超时之前整整一分钟都会发生这种情况。

cfdocument 渲染 PDF 的时间是否有限制?

有没有办法增加超时?

这可能与最大输出缓冲区大小等其他因素有关吗?

这是我用来测试请求超时的自定义函数:

<cffunction name="getCurrentRequestTimeout" output="false" access="private" returntype="numeric">
    <cfset var rcMonitor = createObject("java", "coldfusion.runtime.RequestMonitor") />
    <cfreturn rcMonitor.getRequestTimeout() />
</cffunction> 

我将它放在几个位置以确定超时设置是否正确。在所有情况下,它都返回 3600 秒。

编辑,这里还有一条线索:

此报告交叉引用来自其他 8 个查询(已在控制器中运行)的数据,它在视图中进行交叉引用。大约一年前,我们通过为我们交叉引用的查询创建哈希值大大加快了速度(将运行时间从 1 小时缩短到 10 分钟)。完成了一项任务,以完全删除我们从报告中散列的 4 个查询。一旦我将那些 BuildHashTable 函数调用从视图中拉出并删除了对这些查询的所有引用,页面在 3 分钟后不再崩溃,现在需要 7.5 分钟才能失败。

coldfusion.runtime.RequestTimedOutException: The request has exceeded the allowable time limit Tag: cfoutput
at coldfusion.tagext.io.OutputTag.doStartTag(OutputTag.java:72)
at cfdump2ecfm625244097._factor54(/WEB-INF/cftags/dump.cfm:118)
at cfdump2ecfm625244097.runPage(/WEB-INF/cftags/dump.cfm:1)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:246)
at coldfusion.filter.CFVariablesScopeFilter.invoke(CFVariablesScopeFilter.java:56)
at coldfusion.tagext.lang.ModuleTag.doStartTag(ModuleTag.java:332)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2991)
at cfonerror2ecfm289163184.runPage(D:\CF11\facilopstest\wwwroot\HFDS\events\onerror.cfm:8)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:246)
at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:736)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:572)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2991)
at cfcfml2ecfm2118004321$func$INCLUDEANDRETURNOUTPUT.runFunction(D:\CF11\facilopstest\wwwroot\HFDS\wheels\global\cfml.cfm:138)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2810)
at cfonerror2ecfm1534078820$func$RUNONERROR.runFunction(D:\CF11\facilopstest\wwwroot\HFDS\wheels\events\onerror.cfm:65)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2810)
at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:493)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2992)
at cfcfml2ecfm2118004321$func$SIMPLELOCK.runFunction(D:\CF11\facilopstest\wwwroot\HFDS\wheels\global\cfml.cfm:44)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2810)
at cfonerror2ecfm1534078820$funcONERROR.runFunction(D:\CF11\facilopstest\wwwroot\HFDS\wheels\events\onerror.cfm:14)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:231)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:643)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:432)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:402)
at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:108)
at coldfusion.runtime.AppEventInvoker.onError(AppEventInvoker.java:491)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:532)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:42)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:142)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:78)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.CfmServlet.service(CfmServlet.java:219)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:437)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:197)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

运行 ColdFusion 11,0,07,296330 Enterprise 的 Windows Server 2008

【问题讨论】:

  • 通过什么方法覆盖全局超时?
  • 我正在使用设置 requesttimeout="3600";在控制器和视图中的 中。 (这是一个 cfwheels 应用程序)然后我使用一个附加到控制器超类的函数来测试请求超时是什么。 (添加到问题中)
  • 你确定你的意思是渲染,而不是创建 pdf?
  • 你是对的@Dan_Bracuk 这是一种更清晰的表达方式。
  • 超时可能是在 cfdocument 中引起的,这使得它看起来像请求超时,但实际上并非如此。你用的是什么CF版本?是开发人员、标准还是企业?您可能在创建过程中内存不足。您认为 PDF 最终会有多大?

标签: coldfusion cfdocument


【解决方案1】:

我建议将您的 PDF 逻辑移至 cfthread spawn。请求确实不适合处理这么长的请求,因此您可能会遇到浏览器超时而不是 ColdFusion 超时。但我没有从你的描述中获得足够的信息来确定这一点。

【讨论】:

  • 当应用程序其他区域的许多报告在更长的时间段(即 15 分钟)后成功完成时,是否仍然是浏览器超时?编辑:在 Firefox 中禁用超时后仍然出现错误。
  • 那么它可能不是浏览器超时......但无论如何线程仍然是一个好主意。如果是您的受众,用户不会在浏览器上等待 15 分钟才能完成报告,因此您需要在报告可用时通知他们。
  • @Chris_Tierney 我解决了。问题是笛卡尔积可能已经炸毁了内存。仍然不知道为什么它会提前触发超时,但至少在这种情况下它是固定的。
【解决方案2】:

我解决了。问题是笛卡尔积可能已经炸毁了内存。它导致输出中的一些循环运行的时间比预期的要长得多。我假设这会将大小膨胀到会崩溃的程度。仍然不知道为什么它会提前触发超时,但至少它是固定的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-24
    • 1970-01-01
    • 2017-01-04
    • 2018-07-27
    • 1970-01-01
    • 2012-12-22
    相关资源
    最近更新 更多