Increase timeout in AEM for servlets | Community
Skip to main content
Level 3
August 27, 2023
Solved

Increase timeout in AEM for servlets

  • August 27, 2023
  • 1 reply
  • 2773 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ShaileshBassi

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-sling-servlet-in-aem6-4/m-p/311592

 

Thanks

1 reply

ShaileshBassi
Community Advisor
ShaileshBassiCommunity AdvisorAccepted solution
Community Advisor
August 27, 2023

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-sling-servlet-in-aem6-4/m-p/311592

 

Thanks