HTTP 5xx errors during page rendering in Adobe Experience Manager as a Cloud Service

In Adobe Experience Manager as a Cloud Service, page rendering can become slow or unresponsive when external HTTP calls block request-handling threads. Under increased traffic, blocked threads can lead to thread exhaustion and HTTP 5xx errors for site visitors. To fix this issue, optimize external HTTP calls, implement caching, and configure effective timeout settings.

Description description

Environment

Adobe Experience Manager (AEM) as a Cloud Service (all versions)

Symptoms

  • Increased HTTP 5xx errors (such as 503 or 504) for site visitors
  • Slow or unresponsive product pages, especially during traffic spikes
  • Application logs may show connection timeout errors when calling external services

Cause

When the application makes synchronous external HTTP calls (such as for product or SKU data) directly from the request-handling thread during page rendering, and these calls are not cached or have no effective timeouts, request threads can become blocked waiting for slow external responses. Under increased traffic, this can exhaust available request threads, causing new requests to fail with HTTP 5xx errors.

Resolution resolution

Follow the steps below to resolve the issue.

  1. Review your application code to identify all synchronous external HTTP calls made during page rendering, especially those executed on request-handling threads.

  2. Refactor code to perform external HTTP calls asynchronously or outside the main request thread where possible.

  3. Implement caching for external data (such as product or SKU information) to avoid repeated calls during page rendering. Ensure that cache invalidation logic aligns with your data freshness requirements.

  4. Configure effective connection and read (socket) timeouts on all HTTP clients used for external calls. For example, with Apache HttpClient:

    code language-none
    RequestConfig config = RequestConfig.custom()
        .setConnectTimeout(5000)
        .setSocketTimeout(5000)
        .build();
    

    Adjust timeout values as appropriate for your use case.

  5. Monitor request thread pool utilization in your AEM environment. Set up alerts for high thread-blocking or I/O wait states to detect potential thread exhaustion early.

  6. Test your application under load in a staging environment to ensure that thread exhaustion does not recur under increased concurrent requests.

After implementing these changes, verify that page rendering remains responsive and that HTTP 5xx errors are no longer observed during traffic spikes.

recommendation-more-help
experience-cloud-kcs-help-kbarticles