Configure Target Timeout Limit in Apigee hybrid

Overview

Apigee hybrid supports target io.timeout.millis up to 55000 milliseconds as default. See Target Endpoint Transport Specification.

To increase the target timeout limit for slow target endpoints, make the following changes to your runtime configuration:

  • Configure the virtualhosts[].requestTimeout between Istio and Message Processor(MP). See virtualhosts
  • Configure the conf_http_HTTPTransport.io.timeout.millis between MP and Targets

You can configure these settings for individual environments or for all environments in your installation.

Configure virtualhost to change the request timeout limit

The requestTimeout is the maximum time (in seconds) set on a virtual host for a request to be processed by the MP.

To configure the request timeout limit, you can use the virtualhosts[].requestTimeout properties. Make the following changes to your overrides.yaml file:

  1. Add the following stanza to your overrides.yaml file:
    virtualhosts:
    - name: ENV_GROUP_NAME
      requestTimeout: 600   # Increase requestTimeout to 600 seconds
    
  2. You must upgrade one environment group (virtualhost) at a time. Specify the environment group with --set envgroup=ENV_GROUP_NAME. Repeat the following commands for each environment group mentioned in the overrides.yaml file:

    Dry run:

    helm upgrade ENV_GROUP_RELEASE_NAME apigee-virtualhost/ \
      --install \
      --namespace APIGEE_NAMESPACE \
      --set envgroup=ENV_GROUP_NAME \
      -f OVERRIDES_FILE \
      --dry-run=server
    

    ENV_GROUP_RELEASE_NAME is the name with which you previously installed the apigee-virtualhost chart. It is usually ENV_GROUP_NAME.

    Upgrade the chart:

    helm upgrade ENV_GROUP_RELEASE_NAME apigee-virtualhost/ \
      --install \
      --namespace APIGEE_NAMESPACE \
      --set envgroup=ENV_GROUP_NAME \
      -f OVERRIDES_FILE
    
  3. Check the state of the ApigeeRoute (AR).

    Installing the virtualhosts creates ApigeeRouteConfig (ARC) which internally creates ApigeeRoute (AR) once the Apigee watcher pulls environment group-related details from the control plane. Therefore, check that the corresponding AR's state is running:

    kubectl -n APIGEE_NAMESPACE get arc
    
    NAME                                STATE   AGE
    apigee-org1-dev-egroup                       2d
    kubectl -n APIGEE_NAMESPACE get ar
    
    NAME                                        STATE     AGE
    apigee-org1-dev-egroup-cb9a8a                running   2d

Configure individual environments to change target timeout limit

If the proxies having slow target endpoints are in only one or a few environments in your installation, you can configure the environments individually to change the target timeout limit. This avoids adding impact to other environments.

To configure individual environments to change target timeout limit, you can use the envs[].components.runtime properties. Make the following changes to your overrides.yaml file:

  1. Add the following stanza to your overrides.yaml file:
    envs:
    - name: ENV_NAME
      components.
        runtime:
          cwcAppend:
            conf_http_HTTPTransport.io.timeout.millis: 600000   # Increase io.timeout.millis to 600000 milliseconds
    
  2. You must upgrade one environment ∂at a time. Upgrade the apigee-env chart for each environment you are updating:

    Dry run:

    helm upgrade ENV_RELEASE_NAME apigee-env/ \
      --install \
      --namespace APIGEE_NAMESPACE \
      --set env=ENV_NAME \
      -f OVERRIDES_FILE \
      --dry-run=server
    
    • ENV_RELEASE_NAME is a name used to keep track of installation and upgrades of the apigee-env chart. This name must be unique from the other Helm release names in your installation. Usually this is the same as ENV_NAME. However, if your environment has the same name as your environment group, you must use different release names for the environment and environment group, for example dev-env-release and dev-envgroup-release. For more information on releases in Helm, see Three big concepts class="external" in the Helm documentation.
    • ENV_NAME is the name of the environment you are upgrading.
    • OVERRIDES_FILE is your edited overrides.yaml file.
  3. Upgrade the chart:
    helm upgrade ENV_RELEASE_NAME apigee-env/ \
      --install \
      --namespace APIGEE_NAMESPACE \
      --set env=ENV_NAME \
      -f OVERRIDES_FILE
    
  4. Verify it is up and running by checking the state of the respective env:

    kubectl -n APIGEE_NAMESPACE get apigeeenv
    
    NAME                          STATE       AGE   GATEWAYTYPE
    my-org-my-env-123abc          running     2d

Configure all environments to change target timeout limit

Changes to your runtime stanza will change target timeout limit for all environments in your installation. You can override these settings for individual environments with the runtime properties.

  1. Add the following stanza to your overrides.yaml file:
    runtime:
      cwcAppend:
        conf_http_HTTPTransport.io.timeout.millis: 600000   # Increase io.timeout.millis to 600000 milliseconds
    
  2. Upgrade the apigee-env chart for each environment in your installation:

    Dry run:

    helm upgrade ENV_RELEASE_NAME apigee-env/ \
      --install \
      --namespace APIGEE_NAMESPACE \
      --set env=ENV_NAME \
      -f OVERRIDES_FILE \
      --dry-run=server
    

    Upgrade the chart:

    helm upgrade ENV_RELEASE_NAME apigee-env/ \
      --install \
      --namespace APIGEE_NAMESPACE \
      --set env=ENV_NAME \
      -f OVERRIDES_FILE