Document ID: 3839
Updated: Mar 07, 2006
Contents
Introduction
This document provides a sample configuration to apply Cisco WebNS Software Version 4.0 HTTP header load balancing to the Content Services Switch (CSS).
Prerequisites
Requirements
There are no specific requirements for this document.
Components Used
This document is not restricted to specific software and hardware versions.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.
Conventions
Refer to the Cisco Technical Tips Conventions for more information on document conventions.
Background Information
In some cases, groups of web servers can contain different representations of the same content that has been modified for different end users. For example, a client that runs a browser on a Palm Pilot may want the same content with less graphics. Or, Swedish users may want to see the content in Swedish or in English, but not in German.
HTTP header load balancing allows the CSS to make more intelligent load-balancing decisions on the basis of HTTP header information in the client request. HTTP header load balancing eliminates the need for the content provider to duplicate content in various forms across all the servers.
This feature enables you to:
-
Split the web farm for different types of users
-
Intelligently bypass noncacheable traffic
-
Prioritize traffic from normal client browsers over the metasearch services
The CSS can use these HTTP header fields in order to make load-balancing decisions:
msisdn HTTP extension MSISDN request header referer HTTP Referer request header accept HTTP Accept request header encoding HTTP Accept-Encoding request header charset HTTP Accept-Charset request header connection HTTP Connection general header cookies HTTP Cookie header cache-control HTTP Cache-Control general header pragma HTTP Pragma general header host HTTP Host request header language HTTP Accept-Language request header user-agent HTTP User-Agent request header request-line HTTP Request-Line
With WebNS Software Version 7.x, the CSS can use a custom HTTP header-field type in order to make load-balancing decisions. Here is a description:
custom HTTP custom header field tag
Configure
In this section, you are presented with the information to configure the features that this document describes.
Note: Use the Command Lookup Tool (registered customers only) to obtain more information on the commands in this section.
You can configure the CSS to inspect incoming content requests for HTTP header-field information. The CSS then directs the requests to the servers that are designed to handle the type of content that is requested. HTTP header load balancing allows a web hoster to specify keywords in the HTTP header to use for server selection.
The HTTP header load balancing feature introduces these new command-line interface (CLI) commands and modes:
-
header-field-group command
-
header-field command
-
header-field-group mode
In order to enable the HTTP header field load-balance function, create a header-field group. Issue the header-field-group command and the header-field command. Then, associate them with a content rule that has the group of services that you want to use for balancing. Use header-field-group in owner/content mode for the content rule.
Configurations
This document uses these configurations:
| Create Header-Field Group |
|---|
Issue the header-field-group command
in configuration mode in order to add or remove a header-field group. The
syntax of the command is header-field-group
name
.
The header-field-group command takes
you to header-field-group mode.
The
name
is a character
string to identify the header-field group, and the length is 1 to 32
bytes.
These examples add and remove the Palm Pilot header-field
group:
CS100(config)#header-field-group palmpilot CS100(config)#no header-field-group palmpilotThe command to add a header field to a header-field group is header-field. The syntax is: header-field name field_type operator ["header_string"] [search_length]
|
| Add Header-Field Group to the Content Rule |
|---|
Issue the header-field-rule command
within the owner/content mode in order to configure a content rule with a
predefined header-field group. Multiple content rules can use the same
header-field group. Here is the syntax of this command:
header-field-rule group [weight weight_value]
Note: When you use HTTP header fields for load balancing, understand that the values in the fields are not mutually exclusive. For example, suppose that you want to load balance a subset of French users to one set of machines, but you also want to differentiate Microsoft Internet Explorer (IE) users from Netscape users. In this case, it is more important that you send the French users to a specific machine than whether they use Netscape or IE. Therefore, you must be sure that you weight the content rule with the language that contains "fr" with a higher value than the weight of the content rules for Netscape and IE. |
| No Cookie Rule Example |
|---|
!Generated on 07/04/2000 10:54:28
!Active version: ap0350067a
configure
!*************************** GLOBAL ***************************
ip route 0.0.0.0 0.0.0.0 10.10.1.2 1
!************************** CIRCUIT **************************
circuit VLAN1
ip address 10.10.102.200 255.255.0.0
!************************** SERVICE **************************
service cookie-server2
ip address 10.10.102.206
string 10.10.102.206
active
service cookie_server
ip address 10.10.102.205
string 10.10.102.205
active
!********************* HEADER FIELD GROUP *********************
header-field-group cookie
description "client has cookie"
header-field cookie cookies exist
header-field-group no-cookie
description "client has no cookie"
header-field nocookie cookies not-exist
!*************************** OWNER ***************************
owner mysite.com
content cookie_rule
vip address 200.200.200.2
url "/*"
header-field-rule cookie weight 10
advanced-balance cookies
add service cookie_server
add service cookie-server2
port 80
protocol tcp
active
content login
protocol tcp
vip address 200.200.200.2
port 80
url "/"
advanced-balance cookies
add service cookie_server
add service cookie-server2
active
content no_cookie_rule
protocol tcp
vip address 200.200.200.2
port 80
url "/*"
header-field-rule no-cookie weight 20
redirect "www.mysite.com/sorry.html"
active
|
Verify
Use this section to confirm that your configuration works properly.
The Output Interpreter Tool (registered customers only) (OIT) supports certain show commands. Use the OIT to view an analysis of show command output.
Issue the show header-field-group all command in order to verify the configuration:
CS100#show header-field-group all header field groups:
If the header field group is cookie, the client has cookie header-field cookie cookies.
If the header field group is no-cookie, the client does not have a cookie header field.
Troubleshoot
There is currently no specific troubleshooting information available for this configuration.
Related Information
Open a Support Case
(Requires a Cisco Service Contract.)
Related Cisco Support Community Discussions
The Cisco Support Community is a forum for you to ask and answer questions, share suggestions, and collaborate with your peers.
Refer to Cisco Technical Tips Conventions for information on conventions used in this document.
