Legal | Privacy
Configuring OracleAS Web Cache for Session Binding and Load Balancing

Configuring OracleAS Web Cache for Session Binding and Load Balancing

This tutorial describes how to configure OracleAS Web Cache for sesison binding and load balancing.

Approximately 20 minutes

This tutorial covers the following topics:

Overview
Prerequisites
Defining a Second Origin Server
Defining a Ping URL for Application Detection and Origin Server Capacity
Summary
Related Information

Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: Because this action loads all screenshots simultaneously, response time may be slow depending on your Internet connection.)

Note: Alternatively, you can place the cursor over each individual icon in the following steps to load and view only the screenshot associated with that step.


OracleAS Web Cache can distribute load among multiple origin servers via HTTP or HTTPS. For applications that use sessions, OracleAS Web Cache performs session binding to the origin servers as well.

Prerequisites

Before starting this tutorial, you should:

1. Have completed the OBE titled "Configuring OracleAS Web Cache for Caching a J2EE Application"

Recollect that one of the prerequisites for performing Web Cache OBEs is that you should have two instances of Application Server Mid Tier (J2EE and Web Cache). For these OBEs, we have installed both the instances on the same machine. You have worked on the first instance in the first OBE titled "Configuring OracleAS Web Cache for Caching a J2EE Application." The default origin server for instance 1 is localhost 7778. The default origin server for instance 2 will be localhost 7779 because the instances are on the same machine. In this section you will define a second origin server localhost 7779 and map OracleAS Web Cache with the origin servers for load balancing.


1.

From the Oracle Enterprise Manager 10g Application Server Control Console, go to the OracleAS Web Cache Home page. Click the Administration tab.

Move your mouse over this icon to see the image

Click Origin Servers under Properties.

 

Move your mouse over this icon to see the image

 

2.

Click Create to create the second origin server.

Move your mouse over this icon to see the image

 

3.

Enter the following parameter values in their respective fields:

Host: localhost
Port: 7779
Capacity: 100
Routing: Enabled
Failover Threshold: 5
Ping URL: /
Ping Frequency: 10

Leave all other parameters as default and click OK.

Move your mouse over this icon to see the image

 

4.

Click Restart Web Cache to restart Web Cache.

Move your mouse over this icon to see the image

 

Click Yes when prompted for confirmation.

 

Move your mouse over this icon to see the image

 

Move your mouse over this icon to see the image

 

5.

Click Sites.

Move your mouse over this icon to see the image

 

Under Named Sites Definitions, select localhost:7777 and click Edit.

 

Move your mouse over this icon to see the image

 

6.

A new origin server should appear under the Available Origin Servers column. Select that origin server and move it to the Selected Origin Servers column.

Move your mouse over this icon to see the image

 

Click OK.

 

Move your mouse over this icon to see the image

 

 

7.

Click Restart Web Cache to restart Web Cache.

Move your mouse over this icon to see the image

 

Click Yes when prompted for confirmation.

 

Move your mouse over this icon to see the image

 

Move your mouse over this icon to see the image

 

 

 

OracleAS Web Cache detects the availability of the application by sending a user-defined URL to the origin server periodically. If there is no response, then OracleAS Web Cache assumes that the origin server is unavailable. The fact that the origin server fails to respond can also mean that there is a problem with the application. Therefore, the Ping URL serves for application detection as well.

 

1.

Click Web Cache in the breadcrumbs to return to the OracleAS Web Cache Home page.

Move your mouse over this icon to see the image

 

Click Administration tab and then click Origin Servers under Properties.

 

Move your mouse over this icon to see the image

 

2.

Select one of the origin servers and click Edit.

Move your mouse over this icon to see the image

 

3.

In the Ping URL field, enter /hrapp. /hrapp is a redirect header with zero byte size from the origin server. Because /hrapp does not require much resources from the origin server, it is an ideal candidate for ping URL.

Move your mouse over this icon to see the image

 

4.

For the purpose of this OBE, the load at origin server is expected to be low. To lower the number of maximum concurrent connections that OracleAS Web Cache can establish with a particular origin server, change the Capacity to 50. Click OK.

Move your mouse over this icon to see the image

 

5.

Repeat steps 2 through 4 for the other origin server (localhost:7779). Click Restart Web Cache to restart Web Cache.

Move your mouse over this icon to see the image

 

Click Yes when prompted for confirmation.

 

Move your mouse over this icon to see the image

 

Move your mouse over this icon to see the image

 

 

 

In Oracle Application Server 10g Release 2, OracleAS Web Cache offers three options for session binding mechanism: Cookie-Based, OC4J-Based, and Internal Tracking.
The cookie-based session binding mechanism is applicable for all types of Web applications. OracleAS Web Cache generates its own cookie to perform session stickiness to the origin servers, so the session stickiness still persists even if the application changes its session ID.
The OC4J-based mechanism is used if the application you are trying to cache is based on OC4J. OracleAS Web Cache forwards routing information with each request to OC4J through Oracle HTTP Server.
The Internal Tracking mechanism is used if the application does not support cookies or is not OC4J-based. In this case, OracleAS Web Cache maintains an in-memory routing table.
In this section, you will configure Web Cache to use cookie-based sessions.

 

1.

Navigate to the OracleAS Web Cache Home page. Click the Adminsitration tab and then click Sites under Properties.

Place the cursor over this icon to see the image

 

2.

Under Named Site Definitions, select the site, localhost:7777 and click Edit.

Place the cursor over this icon to see the image

 

3.

Click the Advanced tab to go to advanced section.

Place the cursor over this icon to see the image

 

4.

Under Session Binding, make sure that Enable session binding for this site is selected. Select Any Set Cookies from the Session drop-down list and select Cookie-Based from the Session Binding Mechanism drop-down list. Click OK.

Place the cursor over this icon to see the image

 

5.

Click Restart Web Cache to restart Web Cache.

Move your mouse over this icon to see the image

 

Click Yes when prompted for confirmation.

 

Move your mouse over this icon to see the image

 

Move your mouse over this icon to see the image

 

 

1.

Open a browser window and browse the application at http://localhost:7777/hrapp. OracleAS Web Cache serves the cached pages and forwards any requests to the origin servers.

 

2.

Switch back to the Application Server Control Console browser window. Navigate to OracleAS Web Cache Home page. Go to Performance tab and click Origin Servers.

Place the cursor over this icon to see the image

 

3.

Click the link for the first origin server.

Place the cursor over this icon to see the image

 

Check Total Requests under Request Throughput.

 

Place the cursor over this icon to see the image

 

4.

Click the Back button on your browser and click the link for the second origin server.

Place the cursor over this icon to see the image

 

Check Total Requests under Request Throughput.

 

Place the cursor over this icon to see the image

 

Note that most of the requests are going to only one of the origin servers. Session binding is working correctly.

 

 

For J2EE applications, OracleAS Web Cache can use JSESSIONID for session binding. You will have to change the setting for session binding.

 

1.

Navigate back to the OracleAS Web Cache Home page and click the Administration tab. Click Sites under Properties.

Move your mouse over this icon to see the image

 

Select the site localhost:7777 and click Edit.

 

Move your mouse over this icon to see the image

 

2.

Click the Advanced tab to go to the advanced section.

Place the cursor over this icon to see the image

 

Under Session Binding, make sure that Enable session binding for this site is selected. Select JSESSIONID from the Session drop-down menu and select OC4J-Based from the Session Binding Mechanism drop-down menu. Click OK.

 

Place the cursor over this icon to see the image

 

3.

Click Restart Web Cache to restart Web Cache.

Move your mouse over this icon to see the image

 

Click Yes when prompted for confirmation.

 

Move your mouse over this icon to see the image

 

Move your mouse over this icon to see the image

 

4.

Switch to the browser window that you used to browse the application. Browse the pages again at http://localhost:7777/hrapp.

 

5.

Switch back to the Application Server Control Console browser window and verify whether most of the requests are going to one of the origin servers. To verify, follow steps 2 through 4 of the topic titled "Confirming the Configuration for Session Binding."

Place the cursor over this icon to see the image

 

Place the cursor over this icon to see the image

 

 

In this lesson, you have learned how to:

Define a ping URL for the application to detect its availability

Configure OracleAS Web Cache to use cookie-based sessions and JSESSIONID

Related Information

To ask a question about this OBE tutorial, post a query on the OBE Discussion Forum
To learn more about OracleAS Web Cache, click here.

Place the cursor over this icon to hide all screenshots.

Copyright © 2004 Oracle Corporation. All Rights Reserved.

 

 

 

 

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy