txuan
txuan

Reputation: 41

GCP internal http(s) load balancer timeout after 300s

Recently, I've a problem with the internal http(s) load balancer on GCP, about the timeout of backend service (an instance group). After 300 seconds, the API calling to LB will be failed with 408 HTTP response.

I also increase the Connection draining timeout to 1000 seconds, but it still doesn't work.

Is the any parameter I need to set to allow API with reply time more than 300 seconds? Thank you.

Upvotes: 4

Views: 11262

Answers (1)

Ahemad Pasha Mohammed
Ahemad Pasha Mohammed

Reputation: 66

As I understand that you have configured a Backend service timeout to the 1000 seconds which represents the amount of time that the load balancer waits for the backend to return a complete HTTP response.

But it seems that the issue you are getting with error 408 does not appear to be related to Backend service timeout though, but to a TCP session timeout. The TCP session timeout is configurable at the web server software end, used by your backends.

This TCP session timeout is also known as the keepalive timeout and you must configure this timeout at the web server software end, used by your backends. So that its keepalive timeout is longer than 600 seconds to prevent connections from being closed prematurely by the backend services, which can help to keep the TCP session open for a longer duration by reusing the open connection.

Kindly refer the below link to find more detailed information related above solution:

[1] https://cloud.google.com/load-balancing/docs/backend-service#backend_service_settings

[2] https://cloud.google.com/load-balancing/docs/https#timeouts_and_retries

[3] https://cloud.google.com/compute/docs/troubleshooting/general-tips#idle-connections

Upvotes: 3

Related Questions