Request retry

When a back-end server resets a TCP connection, the request retry feature forwards the request to the next available server, instead of sending the reset to the client. By doing reload balancing, the client saves RTT when the appliance initiates the same request to next available service.

The request retry feature is applicable for the following error scenario:

  • Back-end server resets a TCP connection when the appliance sends a request data packet.

How request retry works

The following diagram shows how components interact with each other.

How request retry works

  1. The process starts by enabling AppQoE feature on your appliance.
  2. When the client sends an HTTP or HTTPS request, the load balancing virtual server sends the request to the back-end server.
  3. If the requested service is unavailable, the back-end server resets the TCP connection.
  4. If the AppQoE configuration has “retry” enabled with the desired number of retry attempts specified, the load balancing virtual server uses the configured load balancing algorithm to forward the request to the next available application server.
  5. After the load balancing virtual server receives the response, the appliance forwards the response to the client.
  6. If the available back-end servers are equal or lesser than the retry count and if all the servers send reset, the appliance would respond a 500 internal server error. Consider a scenario with five available servers and the retry count set as six. If all the five servers reset the connection, then the appliance returns a 500 internal server error to the client.
  7. Similarly, if the number of back-end servers is more than the retry count and if the back-end servers reset the connection, the appliance forwards the reset to the client. Consider a scenario with three back-end servers and the retry count set as two. If the three servers reset the connection, then the appliance sends a reset response to the client.

Configure request retry for GET method

For configuring retry feature for GET method, you must complete the following steps.

  1. Enable AppQoE
  2. Add AppQoE action
  3. Add AppQoE policy
  4. Bind load balancing virtual server to AppQoE policy

Enable AppQoE

At the command prompt, type: enable ns feature appqoe

Add AppQoE action

You must configure an AppQoE action to specify if you want the appliance to retry after a TCP reset and the number of retry attempts.

add appqoe action reset_action -retryOnReset ( YES | NO ) -numretries <positive_integer>]

Example:

add appqoe action reset_action –retryOnReset YES –numretries 5

Where, retryOnReset. Enable retry if the back-end server resets a TCP connection. numretries. Retry count.

Add AppQoE policy

To implement AppQoE you must configure AppQoE policy to prioritize incoming HTTP or SSL request in a specific queue.

At the command prompt, type:

add appqoe policy <name> -rule <expression> -action <string>

Example:

add appqoe policy reset_policy -rule http.req.method.eq(get) -action reset_action

Bind load balancing virtual server to Appqoe policy

When a back-end server resets a TCP packet request and if you want the load balancing virtual server to forward the request to the next available service, you must bind the load balancing virtual server to the AppQoE policy.

At the command prompt, type:

bind lb vserver <name> ((<serviceName> (-policyName <string> [-priority <positive_integer>] [-gotoPriorityExpression <expression>] [-type ( REQUEST | RESPONSE )]

Example:

bind lb vserver v1 -policyName reset_policy -type REQUEST -priority 1

Configure request retry for POST requests

You must always exercise caution when you reload balance requests that write data into the back-end server. For such requests, ensure the content length is short. If the content length is long, then it might result in resource consumption. Follow the steps given below to configure reload balancing for POST requests.

  1. Enable AppQoE
  2. Add AppQoE action
  3. Add AppQoE policy
  4. Bind load balancing virtual server to AppQoE policy

Enable AppQoE

At the command prompt, type:

enable ns feature appqoe

Add Appqoe action

You must add an AppQoE action to retry after a TCP reset and number of retry attempts.

add appqoe action reset_action -retryOnReset ( YES | NO ) -numretries <positive_integer>]

Example:

add appqoe action reset_action –retryOnReset YES –numretries 5

Add Appqoe policy

To implement AppQoE you must configure AppQoE policy to define how to queue the connections in a specific queue.

At the command prompt, type:

add appqoe policy <name> -rule <expression> -action <string>

Example:

add appqoe policy reset_policy -rule HTTP.REQ.CONTENT_LENGTH.le(2000) -action reset_action

Note:

You can use this configuration if you prefer to restrict the request retry feature for content length less than 2000.

Bind load balancing virtual server to AppQoE policy

When a back-end server resets a TCP packet request and if you want the load balancing virtual server to forward the request to the next available service through a specific queue, you must bind the load balancing virtual server to the AppQoE policy.

At the command prompt, type:

bind lb vserver <name> ((<serviceName> (-policyName <string> [-priority <positive_integer>] [-gotoPriorityExpression <expression>] [-type ( REQUEST | RESPONSE )]

Example: bind lb vserver v1 -policyName reset_policy -type REQUEST -priority 1

Configure AppQoE policy for request retry by using the Citrix ADC GUI

  1. Navigate to AppExpert > AppQoE > Policies.
  2. In the AppQoE Policies page, click Add.
  3. In the Create an AppQoE Policy page, set the following parameters: a. Name. AppQoE policy name b. Action. Add or edit an action. To create an action, see Create AppQoE Action section. c. Expression. Select or enter HTTP.REQ.CONTENT_LENGTH.le (2000) policy expression.
  4. Click Create and Close.

    AppQoE policy for request retry or reload balancing

Configure AppQoE action for request retry balancing by using the Citrix ADC GUI

  1. Navigate to AppExpert > AppQoE > Action.
  2. In the AppQoE Actions page, click Add.
  3. In the Create AppQoE Action page, set the following parameters for retry on TCP reset: a. Retry on TCP Reset. Select the check box to enable retry action for TCP reset. b. Retry Count. Enter the retry count.
  4. Click Create and Close.

    Configure AppQoE action for request retry balancing

Request retry