Oracle Cloud Infrastructure Documentation

Connection Management

After your load balancer connects a client to a backend server, the connection can be closed due to inactivity. Also, you can configure load balancer listeners to control the maximum idle time allowed during each TCP connection or HTTP request and response pair.

Highlights

Three different timeout settings affect your load balancer's behavior:

  • Keep-alive setting between the load balancer and backend server

    The load balancer closes backend server connections that are idle for more than 300 seconds.

  • Keep-alive setting between the load balancer and the client

    The Load Balancing service sets the keep-alive value to maintain the connection for 10,000 transactions or until it has been idle for 65 seconds, whichever limit occurs first. You cannot change the value of this setting.

  • Idle timeout

    You can set the duration of the idle timeout when you create a listener. This setting applies to the time allowed between two successive receive or two successive send network input/output operations during the HTTP request-response phase.

Keep-Alive Settings

The load balancing service does not honor keep-alive settings from backend servers. The load balancer closes backend server connections that are idle for more than 300 seconds. Oracle recommends that you do not allow your backend servers to close connections to the load balancer. To prevent possible 502 errors, ensure that your backend servers do not close idle connections in less than 310 seconds.

The Load Balancing service sets the keep-alive value to maintain the connection for 10,000 transactions or until it has been idle for 65 seconds, whichever limit occurs first. You cannot change the value of this setting.

Connection Configuration

When you create a TCP or HTTP listener, you can specify the maximum idle time in seconds. This setting applies to the time allowed between two successive receive or two successive send network input/output operations during the HTTP request-response phase. If the configured timeout has elapsed with no packets sent or received, the client's connection is closed. For HTTP and WebSocket connections, a send operation does not reset the timer for receive operations and a receive operation does not reset the timer for send operations.

Tip

This timeout setting does not apply to idle time between a completed response and a subsequent HTTP request.

The default timeout values are:

  • 300 seconds for TCP listeners.
  • 60 seconds for HTTP listeners.

Modify the timeout parameter if either the client or the backend server requires more time to transmit data. Some examples include:

  • The client sends a database query to the backend server and the database takes over 300 seconds to execute. Therefore, the backend server does not transmit any data within 300 seconds.
  • The client uploads data using the HTTP protocol. During the upload, the backend does not transmit any data to the client for more than 60 seconds.
  • The client downloads data using the HTTP protocol. After the initial request, it stops transmitting data to the backend server for more than 60 seconds.
  • The client starts transmitting data after establishing a WebSocket connection, but the backend server does not transmit data for more than 60 seconds.
  • The backend server starts transmitting data after establishing a WebSocket connection, but the client does not transmit data for more than 60 seconds.

The maximum timeout value is 7200 seconds. Contact My Oracle Support to file a service request if you want to increase this limit for your tenancy. For more information, see Service Limits.