Sun Java System Web Proxy Server 4.0.2 2005Q4 Administration Guide

Using Proxy Arrays

About Proxy Arrays

Proxy arrays for distributed caching allow multiple proxies to serve as a single cache. In other words, each proxy in the array will contain different cached URLs that can be retrieved by a browser or downstream proxy server. Proxy arrays prevent the duplication of caches that often occurs with multiple proxy servers. Through hash-based routing, proxy arrays route requests to the correct cache in the proxy array.

Proxy arrays also allow incremental scalability. In other words, if you decide to add another proxy to your proxy array, each member’s cache is not invalidated. Only 1/n of the URLs in each member’s cache, where n is the number of proxies in your array, will be reassigned to other members.

Routing through Proxy Arrays

For each request through a proxy array, a hash function assigns each proxy in the array a score that is based on the requested URL, the proxy’s name and the proxy’s load factor. The request is then routed to the proxy with the highest score.

Since requests for URLs can come from both clients and proxies, there are two types of routing through proxy arrays: client to proxy routing and proxy to proxy routing.

In client to proxy routing, the client uses the Proxy Auto Configuration (PAC) mechanism to determine which proxy to go through. However, instead of using the standard PAC file, the client uses a special PAC file which computes the hash algorithm to determine the appropriate route for the requested URL, Routing through Proxy Arrays shows client to proxy routing.

In Routing through Proxy Arrays, each member of the proxy array loads and polls the master proxy for updates to the PAT file. Once the client has a PAC file, it only needs to download this file again if the configuration changes. Generally, clients will download the PAC file at restart.

The proxy server can automatically generate the special PAC file from the Proxy Array Membership Table (PAT) specifications made through the administration interface.

In proxy to proxy routing, proxies use a PAT (Proxy Array Table) file to compute the hash algorithm instead of the PAC file used by clients. The PAT file is an ASCII file that contains information about a proxy array, including the proxies’ machine names, IP addresses, ports, load factors, cache sizes, etc. For computing the hash algorithm at the server, it is much more efficient to use a PAT file than a PAC file (which is a JavaScript file that has to be interpreted at run-time). However, most clients do not recognize the PAT file format, and therefore, must use a PAC file. Routing through Proxy Arrays shows proxy to proxy routing.

The PAT file will be created on one proxy in the proxy array - the master proxy. The proxy administrator must determine which proxy will be the master proxy. The administrator can change the PAT file from this master proxy server and all other members of the proxy array can then manually or automatically poll the master proxy for these changes. You can configure each member to automatically generate a PAC file from these changes.

You can also chain proxy arrays together for hierarchical routing. If a proxy server routes an incoming request through an upstream proxy array, the upstream proxy array is then known as a parent array. A parent array is a proxy array that a proxy server goes through. In other words, if a client requests a document from Proxy X, and Proxy X does not have the document, it sends the request to Proxy Array Y instead of sending it directly to the remote server. So, Proxy Array Y is a parent array. In Routing through Proxy Arrays, Proxy Array 1 is a parent array to Proxy Array 2. A member of Proxy Array 2 loads and polls for updates to the parent array’s PAT file. Usually, it polls the master proxy in the parent array. The hash algorithm for the requested URL is computed using the downloaded PAT file and the member in the Proxy Array 2 then retrieves the requested URL from whichever proxy in Proxy Array1 that has the highest score. In Routing through Proxy Arrays, Proxy B has the highest score for the URL requested by the client.

Figure 12–4 Client to Proxy Routing

Diagram showing client to proxy routing.

Figure 12–5 Proxy to Proxy Routing

Diagram showing proxy to proxy routing.

ProcedureTo set up a proxy array

Steps
  1. From the master proxy, do the following steps:

    1. Create the proxy array. For more information on creating the member list, see Creating a Proxy Array Member List .

    2. Generate a PAC file from your PAT file. You only need to generate a PAC file if you are using client to proxy routing. For more information on generating a PAC file from a PAT file, see Generating a PAC File from a PAT File .

    3. Configure the master member of the array. For more information on configuring master members, see Configuring Proxy Array Members .

    4. Enable routing through a proxy array. For more information on enabling routing through a proxy array, see Enabling Routing Through a Proxy Array .

    5. Create a PAT mapping to map the URL “/pat” to the PAT file.

    6. Enable your proxy array. For more information on enabling a proxy array, see Enabling a Proxy Array .

  2. From each of the non-master proxies, do the following steps:

    1. Configure the non-master member of the array. For more information on configuring non-master members, see Configuring Proxy Array Members

    2. Enable routing through a proxy array. For more information on enabling routing through a proxy array, see Enabling Routing Through a Proxy Array.

    3. Enable your proxy array. For more information on enabling a proxy array, see Enabling a Proxy Array .


      Note –

      If your proxy array is going to route through a parent array, you also need to enable the parent array and configure each member to route through a parent array for desired URLs. For more information on parent arrays, see Routing through Parent Arrays.


Creating a Proxy Array Member List

You should create and update the proxy array member list from the master proxy of the array only. You only need to create the proxy array member list once, but you can modify it at any time. By creating the proxy array member list, you are generating the PAT file to be distributed to all of the proxies in the array and to any downstream proxies.


Caution – Caution –

You should only make changes or additions to the proxy array member list through the master proxy in the array. All other members of the array can only read the member list.


ProcedureTo create a proxy array member list

Steps
  1. Access the Server Manager, and click the Caching tab

  2. Click the Configure Proxy Array link. The Configure Proxy Array page displays.

  3. In the Array name field, enter the name of the array.

  4. In the Reload Configuration Every field, enter the number of minutes between each polling for the PAT file.

  5. Click the Array Enabled checkbox.

  6. Click the Create button.


    Note –

    Be sure to click OK before you begin to add members to the member list.



    Note –

    The Create button changes to an OK button after the proxy array has been created.


  7. Click Restart Required. The Apply Changes page displays.

  8. For each member in the proxy array, enter the following and then click OK:

    • Name. The name of the proxy server you are adding to the member list

      • IP Address. The IP address of the proxy server you are adding to the member list

      • Port. This is the port on which the member polls for the PAT file.

      • Load Factor. An integer that reflects the relative load that should be routed through the member.

      • Status. The status of the member. This value can be either on or off. If you disable a proxy array member, the member’s requests will be re-routed through another member

    The master member should be added first before adding the other members.


    Note –

    Be sure to click OK after you enter the information for each proxy array member you are adding.


  9. Click Restart Required. The Apply Changes page displays.

  10. Click the Restart Proxy Server button to apply the changes.

Editing Proxy Array Member List Information

At any time, you can change the information for the members in the proxy array member list. You can only edit the proxy array member list from the master proxy.


Caution – Caution –

You should only make changes or additions to the proxy array member list through the master proxy in the array. If you modify this list from any other member of the array, all changes will be lost.


ProcedureTo edit member list information for any of the members in a proxy array

Steps
  1. Access the Server Manager, and click the Caching tab.

  2. Click the Configure Proxy Array link. The Configure Proxy Array page displays.

  3. In the Member List, select the radio button next to the member that you want to edit.

  4. Click the Edit button. The Configure Proxy Array Member page displays.

  5. Edit the appropriate information.

  6. Click OK.

  7. Click Restart Required. The Apply Changes page displays.

  8. Click the Restart Proxy Server button to apply the changes.


    Note –

    If you want your changes to take effect and to be distributed to the members of the proxy array, you need to update the Configuration ID on the Configure Proxy Array page and click OK. To update the configuration ID, you can simply increase it by one.


Deleting Proxy Array Members

Deleting proxy array members will remove them from the proxy array. You can only delete proxy array members from the master proxy.


Caution – Caution –

You should only make changes or additions to the proxy array member list through the master proxy in the array. If you modify this list from any other member of the array, all changes will be lost.


ProcedureTo delete members of a proxy array

Steps
  1. Access the Server Manager, and click the Caching tab.

  2. Click the Configure Proxy Array link. The Configure Proxy Array page displays.

  3. In the Member List, select the radio button next to the member that you want to delete.

  4. Click the Delete button.


    Note –

    If you want your changes to take effect and to be distributed to the members of the proxy array, you need to update the Configuration ID on the Configure Proxy Array page and click OK. To update the configuration ID, you can simply increase it by one.


  5. Click Restart Required. The Apply Changes page displays.

  6. Click the Restart Proxy Server button to apply the changes.

Configuring Proxy Array Members

You only need to configure each member in the proxy array once, and you must do so from the member itself. You cannot configure a member of the array from another member. You also need to configure the master proxy.

ProcedureTo configure each member of the proxy array

Steps
  1. Access the Server Manager, and click the Caching tab.

  2. Click the Configure Proxy Array Member link. The Configure Proxy Array Member page displays.

  3. In the Proxy Array section, indicate whether or not the member needs to poll for the PAT file by selecting the appropriate radio button. The choices are:

    • Non-Master Member. You should select this option if the member you are configuring is not the master proxy. Any proxy array member that is not a master proxy will need to poll for the PAT file in order to retrieve it from the master proxy.

      • Master Member. You should select this option if you are configuring the master proxy. If you are configuring the master proxy, the PAT file is local and does not need to be polled.

  4. In the Poll Host field, enter the name of the master proxy that you will be polling for the PAT file.

  5. In the Port field, enter the port at which the master proxy accepts HTTP requests.

  6. In the URL field, enter the URL of the PAT file on the master proxy. If on your master proxy, you have created a PAT mapping to map the PAT file to the URL /pat, you should enter /pat in the URL field.

  7. In the Headers File field, enter the full pathname for a file with any special headers that must be sent with the HTTP request for the PAT file (such as authentication information). This field is optional.

  8. Click OK.

  9. Click Restart Required. The Apply Changes page displays.

  10. Click the Restart Proxy Server button to apply the changes.

Enabling Routing Through a Proxy Array

ProcedureTo enable routing through a proxy array

Steps
  1. Access the Server Manager, and click the Routing tab.

  2. Click the Set Routing Preferences link. The Set Routing Preferences page displays.

  3. Select the resource from the drop-down list or click the Regular Expression button, enter a regular expression, and click OK.

  4. Select the Route Through option.

  5. Select the checkboxes for proxy array and/or parent array.

  6. If you choose to route through a proxy array and you want to redirect requests to another URL, select the redirect checkbox. Redirecting means that if a member of a proxy array receives a request that it should not service, it tells the client which proxy to contact for that request.

  7. Click OK.


    Note –

    You can only enable proxy array routing if the proxy server you are configuring is a member of a proxy array. You can only enable parent routing if a parent array exists. Both routing options are independent of each other.



    Caution – Caution –

    Redirect is not currently supported by any clients, so you should not use the feature at this time.


  8. Click Restart Required. The Apply Changes page displays.

  9. Click the Restart Proxy Server button to apply the changes.

Enabling a Proxy Array

ProcedureTo enable a proxy array

Steps
  1. Access the Server Manager, and clcik the Preferences tab.

  2. Click the Configure System Preferences link. The Configure System Preferences page displays.

  3. Click the Yes option for the type of array or arrays you want to enable - either a normal proxy array or a parent array.

  4. Click OK.


    Note –

    If you are not routing through a proxy array, you should make sure that all clients use a special PAC file to route correctly before you disable the proxy array option. If you disable the parent array option, you should have valid alternative routing options set in the Set Routing Preferences page, such as explicit proxy or a direct connection.


  5. Click Restart Required. The Apply Changes page displays.

  6. Click the Restart Proxy Server button to apply the changes.

Redirecting Requests in a Proxy Array

If you choose to route through a proxy array, you need to designate whether you want to redirect requests to another URL. Redirecting means that if a member of a proxy array receives a request that it should not service, it tells the client which proxy to contact for that request.


Caution – Caution –

Redirect is not currently supported by any clients, so you should not use the feature at this time.


Generating a PAC File from a PAT File

Because most clients do not recognize the PAT file format, the clients in client to proxy routing use the Proxy Auto Configuration (PAC) mechanism to receive information about which proxy to go through. However, instead of using the standard PAC file, the client uses a special PAC file derived from the PAT file. This special PAC file computes the hash algorithm to determine the appropriate route for the requested URL.

You can manually or automatically generate a PAC file from the PAT file. If you manually generate the PAC file from a specific member of the proxy array, that member will immediately re-generate the PAC file based on the information currently in the PAT file. If you configure a proxy array member to automatically generate a PAC file, the member will automatically re-generate the file after each time it detects a modified version of the PAT file.


Note –

If you are not using the proxy array feature for your proxy server, then you should use the Create / Edit Autoconfiguration File page to generate your PAC file. For more information see Chapter 17, Using the Client Autoconfiguration File.


Manually Generating a PAC File from a PAT File


Note –

The PAC file can be generated only from the master proxy.


ProcedureTo manually generate a PAC file from a PAT file

Steps
  1. Access the Server Manager of the master proxy, and click the Caching tab.

  2. Click the Configure Proxy Array link. The Configure Proxy Array page displays.

  3. Click the Generate PAC button. The PAC Generation page displays.

  4. If you want to use custom logic in your PAC file, in the Custom logic file field, enter the name of the file containing the customized logic you would like to include in the generation of your PAC file. This logic is inserted before the proxy array selection logic in the FindProxyForURL function. This function is typically used for local requests which need not go through the proxy array.

    If you have already entered the custom logic file on the Configure Proxy Array Member page, this field will be populated with that information. You may edit the custom logic filename if you wish, and the changes you make will transfer to the Configure Proxy Array Member page as well.

  5. In the Default Route field, enter the route a client should take if the proxies in the array are not available.

    If you have already entered the default route on the Configure Proxy Array Member page, this field will be populated with that information. You may edit the default route if you wish, and the changes you make will transfer to the Configure Proxy Array Member page as well.

  6. Click OK.

  7. Click Restart Required. The Apply Changes page displays.

  8. Click the Restart Proxy Server button to apply the changes.

Automatically Generating a PAC File from a PAT File

ProcedureTo automatically generate a PAC file from a PAT file each time a change is detected

Steps
  1. Access the Server Manager, and click the Caching tab.

  2. Click the Configure Proxy Array Member link.The Configure Proxy Array Member page displays.

  3. Select the Auto-generate PAC File checkbox.

  4. If you want to use custom logic in your PAC file, in the Custom Logic File field, enter the name of the file containing the customized logic you would like to include in the generation of your PAC file. This logic is inserted before the proxy array selection logic in the FindProxyFor URL function.

    If you have already entered and saved the custom logic file on the Configure Proxy Array page, this field will be populated with that information. You may edit the custom logic file name if you wish, and the changes you make will transfer to the Configure Proxy Array page as well.

  5. In the Default Route field, enter the route a client should take if the proxies in the array are not available.

  6. If you have already entered and saved the default route on the Configure Proxy Array page, this field will be populated with that information. You may edit the default route if you wish, and the changes you make will transfer to the Configure Proxy Array page as well.

  7. Click OK.

  8. Click Restart Required. The Apply Changes page displays.

  9. Click the Restart Proxy Server button to apply the changes.

Routing through Parent Arrays

You can configure your proxy or proxy array member to route through an upstream parent array instead of going directly to a remote server.

ProcedureTo configure a proxy or proxy array member to route through a parent array

Steps
  1. Enable the parent array. For more information on enabling an array, see Enabling a Proxy Array.

  2. Enable routing through the parent array. For more information on enabling routing through an array, see Enabling Routing Through a Proxy Array.

  3. Access the Server Manager, and click the Caching tab.

  4. Click the Configure Proxy Array Member link. The Configure Proxy Array Member page displays.

  5. In the Poll Host field in the Parent Array section of the page, enter the host name of the proxy in the parent array that you will poll for the PAT file. This proxy is usually the master proxy of the parent array.

  6. In the Port field in the Parent Array section of the page, enter the Port number of the proxy in the parent array that you will poll for the PAT file.

  7. In the URL field, enter the URL of the PAT file on the master proxy. If on your master proxy, you have created a PAT mapping, you should enter the mapping into this URL field.

  8. In the Headers File field in the Parent Array section of the form, full pathname for a file with any special headers that must be sent with the HTTP request for the PAT file (such as authentication information). This field is optional.

  9. Click OK.

  10. Click Restart Required. The Apply Changes page displays.

  11. Click the Restart Proxy Server button to apply the changes.

Viewing Parent Array Information

If your proxy array is routing through a parent array, you need information about the members of the parent array. This information is sent from the parent array in the form of a PAT file. The information in this PAT file is displayed on the View Parent Array Configuration page.

ProcedureTo view parent array information

Steps
  1. Access the Server Manager, and click the Caching tab.

  2. Click the View Parent Array Configuration link. The View Parent Array Configuration page displays.

  3. View the information.