HTTP URL Parsing and Load Balancing


As our first application of Layer 7 server load balancing, let's look at one of the most widely implemented applications ”URL parsing. In basic terms, as we saw in Chapter 2, the URL is "the thing you type in the Web browser," although the precise definition of what distinguishes a URL is a little more subtle. Definitions and examples of each, including a URN, are as follows :

  • Uniform Resource Name (URN): Used to identify a page, object, or resource without the use of a scheme by which it is to be retrieved; for example, www.foocorp.com/ brochures /aboutus.html .

  • Uniform Resource Locator (URL): Used to show both the resource and the scheme used for retrieval; for example, http://www.foocorp.com/brochures /aboutus.html .

  • Uniform Resource Indicator (URI): Used to show the resource, scheme, and any markers within a page; for example, http://www.foocorp.com/brochures /aboutus.html#whereweare .

In general, and for the purposes of this chapter, the term URL is used generically to cover all three instances of document descriptions. If you consider the following HTTP GET request from a client, the elements that would be considered during a URL parsing decision are those after the GET header.

 
 Hypertext Transfer Protocol GET /  brochures/aboutus.html#whereweare HTTP/1.0  \r\n Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg\r\n Accept-Language: en-gb\r\n User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)\r\n Host: www.foocorp.com\r\n Connection: Keep-Alive\r\n \r\n 

It's worth noting that in terms of dealing with the request, the full path , document, and markers are separated from the www.foocorp.com host information, which has been moved to its own unique header. We'll look at how to use these other HTTP headers later in this chapter. Depending on the vendor of the content switch, the decision may optionally include the HTTP version, which is included at the end of the GET request line, giving the ability to make a load balancing decision based on the version of HTTP being supported by the client browser.

Examples of URL Parsing

Now that we've got an understanding of the components which make up what is commonly known as the URL, let's look at some examples of how and when URL parsing can be used.

1. Separating Static and Dynamic Content Types

As an example implementation of URL parsing, let's assume that Foocorp.com needs to separate out the static and dynamic content for their Web site. By static content we mean the images and HTML that make up the static content of the pages ”these can be identified by parsing the URL for file extensions such as *.gif, *.html, *.bmp, and so forth. Other, dynamic content such as executable scripts and ASP pages can be identified by file extensions such as *.asp and *.cgi, and strings such as /cgi-bin/. This approach allows a site designer to maintain two different profiles of server hardware to handle the difference in the nature of the requests . Serving static content requires access only to the static content store, and its delivery is typified by lower requirements on memory and CPU. Dynamic content, on the other hand, requires access to application servers or backend databases, and its delivery incurs greater demands on the memory and CPU resources of the server. Figure 6-5 shows an example of separating static and dynamic content types.

Figure 6-5. Using URL parsing to separate static and dynamic content types.

graphics/06fig05.gif

2. Introducing New Site Elements

A further example of the use of URL parsing is adding new sections to an existing site. Consider Foocorp needing to add another promotional section to the existing Web site, which might run for a limited time and the content for which may be managed by a separate administrator. By adding another URL string match of "/promotion/," for example, a new group of object servers can be used to segregate this subsection of the site. Figure 6-6 shows our previous example expanded to include the introduction of a new sub-site.

Figure 6-6. Introduction of a new subsite using URL parsing.

graphics/06fig06.gif



Optimizing Network Performance with Content Switching
Optimizing Network Performance with Content Switching: Server, Firewall and Cache Load Balancing
ISBN: 0131014684
EAN: 2147483647
Year: 2003
Pages: 85

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net