Troubleshooting slow external API calls with dedicated egress IP in AEM as a Cloud Service
This article explains how to diagnose and resolve high latency for external API calls made from Adobe Experience Manager as a Cloud Service (AEMaaCS) when using Advanced Networking with a dedicated egress IP. It covers common causes and recommended optimizations to improve performance.
Description description
Environment
- Adobe Experience Manager as a Cloud Service (AEMaaCS) with Advanced Networking and a dedicated egress IP enabled.
- Adobe Experience Manager Cloud Manager
Symptoms
External API calls made from AEMaaCS show significantly higher latency when routed through a dedicated egress IP. While direct calls to the same API endpoint (outside of AEM) return quickly, calls from AEM using the dedicated egress IP can be several times slower. This increased latency is especially noticeable on pages that make multiple such API calls, resulting in slower page load times. Custom code or servlets used to measure API response times confirm this behavior.
Cause
The primary cause of the increased latency is the overhead of the TLS handshake when establishing new connections for each API call. If connection pooling isn’t implemented, each request incurs the full handshake cost. The dedicated egress IP and advanced networking configuration may also introduce additional network path latency.
Resolution resolution
Follow the steps below to resolve the issue:
- Verify that your application code uses a connection pool for outbound HTTP requests to external APIs. This reduces the overhead of establishing new connections and TLS handshakes for each request.
- Review your custom code or servlets to confirm that connection pooling is implemented according to Adobe’s HTTP client guidelines for AEMaaCS.
- From the AEM Author or Publish environment, perform a direct curl request to the external API endpoint to measure baseline network latency.
- Compare response times with and without the dedicated egress IP enabled to determine if the additional latency is specific to the advanced networking configuration.
- Use phase-by-phase breakdown tools (such as curl with verbose output) to identify if the TLS handshake is the main contributor to latency.
- In Cloud Manager, confirm that Advanced Networking and the dedicated egress IP are enabled for your environment.
- Ensure that outbound HTTP/HTTPS connections use the platform system proxy configured for AEMaaCS, and that custom code doesn’t bypass these settings.
- After implementing connection pooling and confirming network configuration, monitor API response times for improvement.
- If significant latency persists, consider escalating to Adobe Support for further investigation at the networking or infrastructure level.
- After making changes, retest outbound API calls from AEM to confirm improved response times and consistent use of the dedicated egress IP.