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. Collecting required information
You are here icon. Preparing your cluster
You are not here. Installing the Cloud Pak for Data platform and services
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, you should complete this task if you work with large data sets or have slow network speed 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:
  • Db2®
  • Db2 Data Gate
  • Db2 Warehouse
  • Data Virtualization
  • OpenPages®
  • Watson™ Discovery
  • Watson Knowledge Catalog
  • Watson Speech services

It is also recommended that you 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:


On-premises and private cloud 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 recommended minimum value for most services is 300s, as follows:
    timeout client          300s 
    timeout server          300s 
    Note:
    • The recommended 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 
  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

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. Optional: Customize other route-specific settings. For more information, see the route-specific annotations content in the appropriate OpenShift 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)

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

    You should see 600 as the IdleTimeout value in the connection settings.