Configure HTTP server timeouts
Adjust HTTP server timeouts to prevent connection drops behind load balancers or when handling long-running API requests.
About this task
If your Red Hat Developer Hub (RHDH) instance is deployed behind a load balancer or reverse proxy, you might need to adjust the backend HTTP server timeouts. For example, if the load balancer closes idle connections before the RHDH backend does, clients might experience unexpected disconnects. Similarly, long-running operations such as large catalog imports or slow upstream API calls might require longer request timeouts.
Procedure
app-config.yaml configuration file, add or update the backend.server section:
backend:
server:
keepAliveTimeout:
minutes: 1
headersTimeout:
minutes: 2
requestTimeout:
minutes: 1
timeout:
minutes: 5
maxHeadersCount: 2000
maxRequestsPerSocket: 100
Where:
-
keepAliveTimeout - Maximum time an idle keep-alive connection stays open before the server closes it. Set this higher than your load balancer’s idle timeout to avoid premature disconnects.
-
headersTimeout - Maximum time allowed to receive the complete HTTP request headers. Must be greater than
keepAliveTimeout. -
requestTimeout - Maximum time allowed for the entire HTTP request, including headers and body.
-
timeout - Socket inactivity timeout. Maximum time a socket can remain idle before being closed.
-
maxHeadersCount - Maximum number of incoming HTTP headers allowed per request.
-
maxRequestsPerSocket -
Maximum number of requests a socket can handle before the connection is closed.
When these settings are not configured, the Node.js defaults apply. Timeout values support multiple formats, including human-readable strings, duration objects, and ISO 8601 duration strings. For more information, see Time syntax in Red Hat Developer Hub.
Results
- Verify that long-running requests or idle connections behave as expected with the new timeout values.