Bilal-S / iis2tomcat

AJP Connector between Internet Information Services (IIS) and Apache Tomcat
http://www.boncode.net/boncode-connector
49 stars 32 forks source link

Timeouts just under 3 minutes, otherwise running find. Tried setting timeouts everywhere #81

Closed adamcolony1 closed 5 years ago

adamcolony1 commented 5 years ago

Windows 2019 on AWS. Tomcast 8.5. Current Boncode (think .41?). Lucee.

I have a heavy long-runnning query and am getting what appear to be timeouts or crashes.

connector config in Tomcast server.xml changed to:

web.config on the website changed to add:

<system.web>
<httpRuntime executionTimeout="600" maxRequestLength="2097151" />
</system.web>

Eventlog error from Boncode:

Connection error 2: Connection between Tomcat and IIS experienced error. If you restarted Tomcat this is expected. (1) at BonCodeAJP13.BonCodeAJP13ServerConnection.ConnectionError() at BonCodeAJP13.BonCodeAJP13ServerConnection.p_CreateConnection(BonCodeAJP13PacketCollection packetsToSend) at BonCodeIIS.BonCodeCallHandler.ProcessRequest(HttpContext context)

I am looking for any advice. I can not seem to get this long running request to work. We did have this same code working on Linux previously with Lucee/Tomcat but am now on Windows. Thank you for any advice.

Bilal-S commented 5 years ago

The Boncode connector has only one timeout that is 2 mins (ReadTimeOut). Otherwise its timeouts are determined by IIS executionTimeout.

ReadTimeOut is set in ms and can be changed in BonCodeAPI13.settings file. E.g. 120000 See here: http://www.boncode.net/connector/webdocs/Tomcat_Connector.htm#_Toc520189758

You should also verify your other timeouts: What is the Lucee request timeout on your process? Is there a protocol timeout for Tomcat connection timeout (in server.xml)?

Hope this help, Bilal

adamcolony1 commented 5 years ago

Thank you, My bad. That is the setting that was causing my timeout. The log error was a bit confusing to me as I read it to mean like something else on the server (not a Boncode initiated timeout itself). The lucee request timeout was set to 450 seconds and the Tomcat timeout was setup higher... But now that i adjusted this it is behaving as I expected (though I need to re-arrange or pre-compute some of this data as this script is taking too long)..

Thank you!!

adamcolony1 commented 5 years ago

One further question.. I am noticing after timeout related to this timeout setting problematic behavior on other sites that rely on boncode connector. It seems to have happened repeatedly. As if the timeout event is also causing something larger to occur. Symptom seems to be sudden and random errors like java.lang.NullPointerException within otherwise running applications (that will run fine again after cycling Tomcat / IIS).

Bilal-S commented 5 years ago

Adam: sorry to hear you are experiencing issues when increasing timeouts. I cannot replicate this at this time; my suggestion to you is to see whether you can refactor the long running task into two parts:

1) Task start / checker 2) Task runner

In this, the tast starter starts the task and periodically re-queries status (every 30s?). This would be your UI. The task runner, runs the task as is and notifies the task checker of status (via DB entries, file entries, websockets, what-ever is easiest).

Best, Bilal

adamcolony1 commented 5 years ago

Sorry I may have been unclear. The timeout increase seemed to work fine. It just seemed like even before I increased timeouts when I hit the timeout condition the server sometimes became unstable after. I am assuming it may be unrelated issue stemming from the task itself but several times I have had to restart services to resume proper performance after hitting timeout. Thank you for the advice and yes we are breaking this task into smaller components and pre-computing daily data. This issue has only reared end of month as it uses monthly data and has more data to process end of month but a lot of the data can be cached/pre-computed.

Thank you!