Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

503 - Timeout error

Avatar

Avatar
Give Back
Level 1
ChandraSGupta
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 1
View profile

Avatar
Give Back
Level 1
ChandraSGupta
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

0 solutions
Top badges earned
Give Back
Ignite 1
Validate 1
Boost 1
View profile
ChandraSGupta
Level 1

14-09-2020

I am getting 503 timeout error in my AEM application. The application is getting data from an external system through an AEM servlet and that data is being rendered in UI. The application gets time out if the response time is more than 30 seconds. Is there any specific configuration which is responsible for this timeout. 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,112 likes

Total Posts

3,145 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,112 likes

Total Posts

3,145 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

14-09-2020

Hi,

 

Every AEM function which reaches out to an external system should be guarded by a timeout, and in most cases a timeout of more than 30 seconds is inadequate and too high; what's the functionality on the other system which takes 30 seconds to response properly?

 

This gets even more important, if an user makes a request to AEM and AEM in turn makes a request to a different system. The AEM standard timeout is 30 second (which is quite high for an interactive application), so the application on the other system should also respond very quickly, thus a timeout of say 5 seconds is appropriate. Relying on default timeouts is a good way to run a Denial of Service attack against AEM, because if all threads are blocked (waiting on the external system which response very slowly) your AEM doesn't have free threads anymore to handle legitimate requests (which do not require to reach this other system and which could be handled within milliseconds).

 

So: Do not increase the timeout on AEM side, but rather build your application in a more resilient way.

 

Ok, understood. But that means that you reconfigure AEM explicitly for this request.

 

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.

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
MVP
raj_mandalapu
MVP

Likes

124 likes

Total Posts

203 posts

Correct Reply

72 solutions
Top badges earned
Validate 1
Contributor
Shape 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
MVP
raj_mandalapu
MVP

Likes

124 likes

Total Posts

203 posts

Correct Reply

72 solutions
Top badges earned
Validate 1
Contributor
Shape 1
Give Back 5
Give Back 3
View profile
raj_mandalapu
MVP

14-09-2020

I just want to highlight a few things

Taking 30second's time is not a good sign, if you are testing this on a lower environment then I feel it is ok to wait for 30 seconds for a response, but if you want to deploy this to the production with the same configuration then it is going to be a problem the end-user will get frustrated and also it is not good user experience.

Check with the people who are managing the external system and get the SLA's, if the external system always behaves like that I mean takes more than 30 seconds then don't rely on that you need to change your approach.

You can write a scheduler which fetches data from the external system and stores in the AEM repository, the component which you want to display external content will read it from your AEM repository. 

With this, you will get the best user experience and you do not need to wait for on an external system especially when it is not reliable.

 

 

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,348 likes

Total Posts

3,226 posts

Correct Reply

916 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,348 likes

Total Posts

3,226 posts

Correct Reply

916 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

14-09-2020

I think you should check the response from external application as well. Could be issue at external point as well.

You can try though -

Apache Felix Jetty Based HTTP Service

Connection Timeout
Time limit for reaching an timeout specified in milliseconds. This property applies to both HTTP and HTTP connections. Defaults to 60 seconds. (org.apache.felix.http.timeout)