Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Increase timeout in AEM for servlets

Avatar

Level 4

POST call to AEM servlet is getting timeout exactly after 60 seconds.

I'm getting 504 Gateway time out exception 

 

Configuration in AEM

 

1. Apache fleix jetty based http service configuration timeout is 120 sec.

 

2. Dispatcher render timeout is set to 120 sec.

 

3. Additional sling connection is configured during start up

 

Apace sling connection timeout agent

Org.apache.sling.cta 

 

Readtimeout 60 sec

Connection tiimeout 20 sec.

 

 

Our understanding is sling connection timeout is only for outgoing requests of AEM.

 

I don't see any errors in logs as well. The request processing completes. Sometimes it quickly completes the request and sometime it takes 100 seconds.

 

We want to understand why / because of which configuration time out is happening at 60 seconds.

 

We want to keep it to 120 seconds. How can we achieve this?

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @girishb83316758 

The timeout configuration is a safety measure of every system, which allows it to recover from operations which take too long.

If you increase the overall timeout, the loosen this safety net a bit.

In your case you have 2 timeouts to consider:

* The timeout of jetty (the request from user to AEM)

* the timeout of your external request (from AEM to the external system)

 

You have to increase the timeout of both.

 

You should either send data during processing or rather implement this as workflow or sling job. Then you can inititate the job, and regularly check the status. No need to worry about timeouts anymore.

 

Reference to a similar post - https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-set-timeout-for-sli...

 

Thanks

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @girishb83316758 

The timeout configuration is a safety measure of every system, which allows it to recover from operations which take too long.

If you increase the overall timeout, the loosen this safety net a bit.

In your case you have 2 timeouts to consider:

* The timeout of jetty (the request from user to AEM)

* the timeout of your external request (from AEM to the external system)

 

You have to increase the timeout of both.

 

You should either send data during processing or rather implement this as workflow or sling job. Then you can inititate the job, and regularly check the status. No need to worry about timeouts anymore.

 

Reference to a similar post - https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-set-timeout-for-sli...

 

Thanks