ADC

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 the 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.
  • If back-end server resets a TCP connection on SYN establishment

How request retry works when back-end server resets a TCP connection on receiving a request data packet

The following diagram shows how the components interact with each other.

How request retry works

  1. The process starts by enabling the 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 a 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.

How request retry works when the back-end server resets a TCP connection on SYN establishment

The following diagram shows the components interact with each other:

How request retry works

  1. The process starts by enabling the AppQoE feature on your appliance.
  2. When the client sends an HTTP or HTTPS request, the load balancing virtual server initiates connection to back-end server.
  3. If the requested service is unavailable on the TCP SYN establishment, 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 on the TCP SYN establishment, 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 packet to the client.

Configure request retry for GET method

For configuring the retry feature for a 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 the AppQoE policy to prioritize the 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 the 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 NetScaler 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:

    • Name. AppQoE policy name
    • Action. Add or edit an action. To create an action, see Create AppQoE action section.
    • Expression. Select or enter HTTP.REQ.CONTENT_LENGTH.le (2000) policy expression.
  4. Click Create and Close.

Configure AppQoE action for request retry balancing by using the NetScaler 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 request retry for GET method when back-end server resets on TCP SYN establishment

The CLI and GUI configuration is similar to the steps followed for the GET method. For more information, see Configure request try for GET method section. When the back-end server resets a connection.

Request retry