Expand my Community achievements bar.

SOLVED

Timeout error for JMX

Avatar

Level 1

I have JMX that is traversing around 20000 nodes and runs for ~45 mins.

Locally it runs without error but it fails on testing environment with this error.

"Gateway Timeout

The gateway did not receive a timely response

from the upstream server or application."

 

Any idea how i can solve this?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Dear Nadi,

 

Having to sit on a screen for 45 minutes is not great design of your system. What happens if you machine restarts or you accidentally close the browser window?

 

Design JMX in a way that you have execute method and status method.

 

String status(); // tells you the status of the current traversing progress

void start() throws Exception // starts the traversing and returns when successfully started, throws an exception when can't start

void stop() throws Exception; // potentially useful as well in case JMX actually runs for 45 minutes 

 

Anyway, it could be Apache that times out your request, look out for TimeOut setting in your Apache config and increase that value to avoid timeouts.

P.S. it's better to redesign your JMX then bump TimeOut to an hour long value.

 

Regards,

Peter

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Dear Nadi,

 

Having to sit on a screen for 45 minutes is not great design of your system. What happens if you machine restarts or you accidentally close the browser window?

 

Design JMX in a way that you have execute method and status method.

 

String status(); // tells you the status of the current traversing progress

void start() throws Exception // starts the traversing and returns when successfully started, throws an exception when can't start

void stop() throws Exception; // potentially useful as well in case JMX actually runs for 45 minutes 

 

Anyway, it could be Apache that times out your request, look out for TimeOut setting in your Apache config and increase that value to avoid timeouts.

P.S. it's better to redesign your JMX then bump TimeOut to an hour long value.

 

Regards,

Peter

Thank you Peter, i will check if TimeOut setting helps and share the result

Avatar

Employee Advisor

Your request is taking too long, thus the connection between your client and the server is terminated. And instead of increasing the timeout (which is unlikely to help, because sooner or later you will need to increase it again), you should speed up the processing of the call. Either as suggested (separating the start of the process from getting the result) or speeding up the algorith, Traversing 20k of nodes (assuming TarMK) is a matter of a few seconds, and that shouldn't cause a timeout).

 

Jörg