Mallas casiortogonales
Problema 2 Determinar las mallas que son los m´ınimos del problema m´ın
4.4. Algunos resultados num´ ericos
4.4.2. Regiones irregulares
The diagram in Figure 21 illustrates a configuration that uses content-aware cache switching to
cache GIF files on one set of cache servers and different kinds of files on another set. In this configuration, Cache Group 1 consists of three cache servers. CacheServer1 and
CacheServer2 are allocated to Server Group ID = 1, and CacheServer3 is allocated to Server Group ID = 2. The ServerIron ADX has CSW policies in place that cause HTTP requests to be directed to the cache servers as follows:
•
HTTP requests containing URL strings that end with the text "gif" are sent to one of the cacheservers in Server Group ID = 1.
•
If a URL string does not end with the text "gif", the HTTP request is sent to the cache server inServer Group ID = 2.
FIGURE 21 Content-aware cache switching
The first time a client requests a URL that ends with "gif" (for example, /home/main/banner.gif) the following events take place.
Internet CacheServer1 192.168.1.101 SI RAS BAR CacheServer2 192.168.1.102 CacheServer3 192.168.1.103
Server Group ID=1
Cache Group 1
Server Group ID=2
Client requests for URLs that end with gif are directed to one of the cache servers in this server group
Client requests for all other URLs are directed to the cache server in this server group
Content-aware cache switching
2
1. Because the URL ends with "gif", the CSW policy on the ServerIron ADX directs the request to one of the cache servers in Server Group ID=1.
2. When a server group consists of more than one cache server, the ServerIron ADX uses a hashing algorithm to select one of the cache servers, and directs the request to the selected cache server.
3. Because this is the first time the content is requested, the selected cache server does not have the content stored, so the cache server retrieves it from the Internet.
4. The cache server receives the content, caches it, and sends it to the requesting client. The next time a client requests the content, the following events take place.
1. Because the URL begins with "gif", the CSW policy directs the request to one of the cache servers in Server Group ID=1.
2. The ServerIron ADX hashes the URL string, selecting the same server it selected previously. 3. This time the cache server has the content and does not have to go to the Internet to get it; it
sends the cached content to the requesting client.
Setting up content-aware cache switching consists of the following steps. 1. Enabling TCS on the ServerIron ADX
2. Setting up CSW policies 3. Configuring the cache servers
4. Assigning the cache servers to a cache group
Enabling TCS
To enable TCS on all interfaces (globally) of the ServerIron ADX shown in Figure 21, enter the
following command.
ServerIronADX(config)#ip policy 1 cache tcp 80 global
Syntax: ip policy <index> cache | normal | high tcp | udp <tcp/udp-portnum> global | local
Setting up the CSW policies
The CSW policies define selection criteria for URL strings and specify what happens when a URL string matches the selection criteria. In content-aware cache switching, if an HTTP request contains a URL string that matches a policy’s selection criteria, the HTTP request can be sent to a load balanced cache server group or to another policy for additional matching.
NOTE
The CSW policies discussed in this section apply to the example in Figure 21 on page 74.
The following commands define a CSW policy called “p1”.
ServerIronADX(config)#csw-rule r1 url suffix “gif” ServerIronADX(config)#csw-policy p1
ServerIronADX(config-csw-p1)#match r1 forward 1 ServerIronADX(config-csw-p1)#default forward 2 ServerIronADX(config-csw-p1)#exit
Content-aware cache switching
2
The csw-rule r1 url suffix gif command consists of two parts. The first part specifies what kind of matching the policy does on the selection criteria. Three kinds of matching methods are supported:
•
The prefix keyword compares the selection criteria to the beginning of the URL string.•
The suffix keyword compares the selection criteria to the end of the URL string.•
The pattern keyword looks for the selection criteria anywhere within the URL string.The second part of the specifies the selection criteria, which can be up to 80 characters in length; In this example, the selection criteria is the text string "gif". Because the matching method is suffix, the policy looks at the end of the URL string. If the URL string ends with the text "gif", then the URL string meets the selection criteria.
NOTE
In addition to using text as selection criteria, you can use an asterisk (*) as a wildcard character to specify one or more characters at the end of a URL string. For example, using "/ho*" as the selection criteria matches /home, /hotels, and /home/main/index.html.
If you are using the suffix matching method, you cannot use an asterisk (*) as a wildcard character. The asterisk wildcard character is valid for the prefix and pattern matching methods only.
Syntax: csw-policy <policy-name>
The csw-policy p1 command sets the name of the policy. Syntax: match r1 forward <server-group-id>
If the URL string meets the selection criteria, the second part of the match command specifies what to do with the HTTP request. In this example, the 1 in the command causes the HTTP request to be sent to the cache server group whose ID = 1. Specifying 0 in the match command causes the request to be directed to the Internet. A CSW policy can contain multiple match commands, each with different selection criteria.
Syntax: default forward <server-group-id>
The default forward 2 command specifies what happens when the URL string does not meet any of the selection criteria in a CSW policy’s match command. With a match command, you can specify a server group ID number. In this example, if a URL string does not match the selection criteria in policy p1, it is sent to Server Group 2 for evaluation.
NOTE
As the diagram in Figure 21 illustrates, there is only one cache server in Server Group ID = 2. Even
so, the match command must refer to a server group rather than an actual cache server. Server groups can consist of one or more cache servers.
NOTE
By default, if no cache server is found in the server group then the request is bypassed to the Internet. To override this behavior, you need to enable 'group-failover' under the cache-group. Refer
to the section '“Configuring group-failover” on page 78 for further details.