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
You are not here. Setting up a client workstation
You are not here. Setting up a cluster
You are not here. Collecting required information
You are not here. Preparing to run installs from a private container registry
You are here icon. Preparing the cluster for Cloud Pak for Data
You are not here. Preparing to install an instance of Cloud Pak for Data
You are not here. Installing an instance of Cloud Pak for Data
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

If you plan to install the following services, you must adjust the load balancer timeout settings to prevent connections from being closed before processes complete:

  • Cognos® Dashboards
  • 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.
Note: If you have an internal and external load balancer on your cluster, ensure that you apply the changes to the external load balancer.
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.

  1. 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 (5 minutes), 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 Cognos Dashboards is 600s (10 minutes), as follows:
      timeout client          600s 
      timeout server          600s 
    • The minimum value for Speech services is 1800s, as follows:
      timeout client          1800s 
      timeout server          1800s 
  2. 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
  3. 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.

  1. 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.

  2. Customize other route-specific settings. For more information, Route-specific annotations in the Red Hat OpenShift Container Platform documentation:
Note: On a Virtual Private Cloud (VPC) Gen2 cluster, the load balancer timeout is set to the following values:
  • Server-side connection attempt: 5 seconds
  • Client-side idle connection: 50 seconds
  • Server-side idle connection: 50 seconds
You cannot change these values. For more information, see Connection timeouts.


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.

  1. Obtain the VPC ID for your ROSA cluster from the AWS console.
  2. Export the VPC as VPC_ID, as shown in the following example:
    export VPC_ID=vpc-0047646ab74dd2f61
  3. 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
  4. 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.