Reputation: 2557
I have a SpringBoot app hosted on OpenShift-Enterprise. I have one request that takes significantly more time to process due to integration with other systems. That request started getting 504 Gateway timeout
error on browser exactly after the 30s.
On investigation, we found that OpenShift is using HA Proxy load-balancing, which has a client timeout of 30s.
defaults
timeout connect 10s
timeout client 30s
timeout server 30s
log global
mode http
option httplog
maxconn 3000
Now, we fixed the issue by increasing this value to some high number. But, DevOps has a concern that this might lead to the Stale Connection problem. I did not find any resource confirming that high value of HTTP timeouts could lead to such issues. We want to move new configuration to production.
Any thoughts?
Upvotes: 2
Views: 1623
Reputation: 4693
What do your DevOps team concern about "Stale Connection" ? In my experience, "Stale Connection" can be occurred the problem of concurrent session overflow on the LB or the entry point(such as HAProxy) if a ton of requests are accessed within the certain timeout you configured. If your team also is concerned like this risk, then you should separate the access path for the certain process required long time unless you fix the long time process to be more shortter one.
For instance, only one route for the long time process can configure the specific timeout using "haproxy.router.openshift.io/timeout" annotaion. Refer "Route-specific Annotations for more annotation details.
Usually, most close entry point with client should manage the most sessions than other stack, so LB should set more longger timeout than client timeout value. Some system can configure 300 seconds on it, so first you check why the timeout can be risk as "Stale Connection" through performance test and so on.
Upvotes: 1