Changing load balancer timeout settings
To prevent connections from being closed before processes complete, you might need to adjust the timeout settings on your load balancer node.
- Installation phase
- Setting up a client workstation
- Who needs to complete this task?
- A cluster administrator must complete this task.
- When do you need to complete this task?
- You must complete this task if you plan to install specific services.
Even if you don't plan to install the specified services, complete this task if you work with large data sets or have slow network speeds, to prevent connections from timing out.
About this task
- Db2®
- Db2 Data Gate
- Db2 Warehouse
- OpenPages®
- Watson™ Discovery
- Watson Knowledge Catalog
- Watson Query
- Watson Speech services
- Watson Studio
You also might need to adjust the timeout settings if you are working with large data sets or you have slower network speeds. For example, you might need to increase the timeout value if you receive a timeout or failure when you upload a large file.
Procedure
Complete the appropriate task for your environment:
Deployment environment | Managed | Self-managed |
---|---|---|
On-premises | No changes are required. | See Self-managed on-premises deployments |
IBM® Cloud | See IBM Cloud deployments | See IBM Cloud deployments |
AWS | See Red Hat® OpenShift® Service on AWS (ROSA) | See Red Hat OpenShift Service on AWS (ROSA) |
Microsoft Azure | You cannot change the timeout settings in Azure Red Hat OpenShift (ARO) environments. The default timeout value is 4 minutes (240 seconds). | See the Microsoft Azure load balancer documentation |
Google Cloud | Not applicable | Not applicable |
Self-managed on-premises deployments
The following procedure shows how to change the timeout settings if you are using HAProxy. If you are using a load balancer other than HAProxy, see the documentation for your load balancer for information about how to configure the timeout settings.
If you are using HAProxy, the load balancer node is the OpenShift cluster public node.
- On the load balancer node, check the HAProxy timeout settings in the
/etc/haproxy/haproxy.cfg file. The minimum value for most services is 300s, as follows:
timeout client 300s timeout server 300s
Note:- The minimum value for Db2 Data
Gate is 7500s,
as follows:
timeout client 7500s timeout server 7500s
- The minimum value for Watson Speech
services is
1800s, as follows:
timeout client 1800s timeout server 1800s
- The minimum value for Db2 Data
Gate is 7500s,
as follows:
- If necessary, run the following command to change the timeout values to
the highest values that are required based on the services that you plan to install and use:
- To change the
timeout client
setting, enter the following command:sed -i -e "/timeout client/s/ [0-9].*/ 5m/" /etc/haproxy/haproxy.cfg
- To change the
timeout server
setting, enter the following command:sed -i -e "/timeout server/s/ [0-9].*/ 5m/" /etc/haproxy/haproxy.cfg
- To change the
- Run the following command to apply the changes that you made to the HAProxy
configuration:
systemctl restart haproxy
IBM Cloud deployments
The following procedures show how to change the timeout settings if you are using HAProxy. If you are using a load balancer other than HAProxy, see the documentation for your load balancer for information about how to configure the timeout settings.
If you are using HAProxy, the load balancer node is the OpenShift cluster public node.
If you are setting HAProxy timeout settings for Cloud Pak for Data on IBM Cloud, you can configure route timeouts by using the
oc annotate
command.
- Use the following command to set the server-side timeout for the HAProxy route to 360
seconds:
oc annotate route zen-cpd --overwrite haproxy.router.openshift.io/timeout=360s
If you don't provide the units,
ms
is the default. - Customize other route-specific settings. For more information,
Route-specific annotations in the Red Hat
OpenShift Container Platform documentation:
-
Version 4.8
4.6.0 - 4.6.2 only
- Version 4.10
4.6.x
- Version 4.12
4.6.4 or later
-
Version 4.8
- Server-side connection attempt: 5 seconds
- Client-side idle connection: 50 seconds
- Server-side idle connection: 50 seconds
Red Hat OpenShift Service on AWS (ROSA) deployments
The following procedures show how to change the timeout settings if you are using Cloud Pak for Data on ROSA.
- Obtain the VPC ID for your ROSA cluster from the AWS console.
- Export the VPC as VPC_ID, as shown in the following
example:
export VPC_ID=vpc-0047646ab74dd2f61
- Run the following
script:
LOAD_BALANCER=`aws elb describe-load-balancers --output text | grep $VPC_ID | awk '{ print $5 }' | cut -d- -f1 | xargs` for lbs in ${LOAD_BALANCER[@]}; do aws elb modify-load-balancer-attributes --load-balancer-name $lbs --load-balancer-attributes "{\"ConnectionSettings\":{\"IdleTimeout\":600}}" done
- To validate the changes, run the following
script:
LOAD_BALANCER=`aws elb describe-load-balancers --output text | grep $VPC_ID | awk '{ print $5 }' | cut -d- -f1 | xargs` for lbs in ${LOAD_BALANCER[@]}; do aws elb describe-load-balancer-attributes --load-balancer-name $lbs done
The IdleTimeout value in the connection settings is shown as
600
.