Oracle9iAS Web Cache Administration and Deployment Guide Release 2.0.0 Part Number A90372-04 |
|
This chapter describes the steps to initially configure Oracle Web Cache to begin caching application Web server content after installation.
This chapter contains these topics:
To start Oracle Web Cache to begin initial configuration:
webcachectl start
When Oracle Web Cache is installed, it is set up with default passwords for administration and invalidation requests. In addition, the computer on which you installed Oracle Web Cache is the default trusted host.
To change the security settings:
Configuration and operational tasks can be performed with the Oracle Web Cache administrator
user. The administrator
user has a default password of administrator
set up during installation. Before you begin configuration, change the default password to a secure password.
The Security page appears in the right pane.
The Change Administration User Password dialog box appears.
administrator
in the Old Password field and a new password between four and 10 characters in the New Password and Confirm New Password fields.
The invalidation administrator has a user ID of invalidator
, whose default password of invalidator
is set up during installation.
By default, the computer on which you installed Oracle Web Cache is the trusted host.
The Change Trusted Subnets dialog box appears.
All subnets
Select to allow administration requests from all computers in all the subnets in the network.
This machine only
Select to allow administration and invalidation requests from only this computer.
Enter list of IPs
Select to allow administration and invalidation requests from all IP addresses you enter in a comma-separated list. You can enter IP addresses in one of the following formats:
Example: 10.1.2.3
Example: 10.1.0.0/255.255.0.0
allows all the hosts in the 10.1
subnet access.
Example: 10.1.0.0/16
allows all the hosts in the 10.1
subnet access. This example is similar to the network/netmask example, except the netmask consists of nnn high-order 1 bits.
By default, the user that performed the installation is the owner of Oracle Web Cache executables. Only this can user can execute webcachectl start|stop
commands.
If you changed the password for the
Note:
administrator
user in Step 2, you must restart the admin server process with the webcachectl start
command when performing "Task 8: Restart Oracle Web Cache".
For Oracle Web Cache to act as a virtual server for a Web site, configure Oracle Web Cache with information about the Web site, including the host names of the application Web servers. In addition, specify a listening port from which Oracle Web Cache can receive browser requests.
To configure Oracle Web Cache with Web site information:
By default, the listening port and host name of the Oracle HTTP Server are configured. Oracle HTTP Server has a default listening port of 7777 on UNIX and 80 on Windows.
The Application Web Servers page appears in the right pane.
The Edit/Create Application Web Server page dialog box appears.
In multiple application Web server configurations, the capacity of an individual server is weighted against the total capacity of all configured application Web servers. When capacity is set, Oracle Web Cache assigns a weighted load percentage to the application Web server. The load specifies the percentage of requests that this application Web server will handle. The load percentage is calculated from the following formula:
Application Web Server Capacity / Total Capacity of All Application Web Servers
For example, if one application Web server has a capacity of 50 and a second application Web server has a capacity of 40 for a total capacity of 90, then the first server is assigned a load percentage of 55 and the second server is assigned a load percentage of 45.
50/90 = 55% 40/90 = 45%
If this is the only application Web server, then the load will be 100 regardless of the capacity.
The maximum number of concurrent connections that an application Web server can handle is determined by load testing the application Web server until it runs out of CPU, responds slowly, or until a backend database reaches full capacity.
The default is five requests.
If an application Web server fails any time after Oracle Web Cache has started to send a request, then Oracle Web Cache increments the failure counter. The failure counter is reset in the event of a successful application Web server response. A request is considered failed if:
Once the threshold is met, Oracle Web Cache considers the application Web server down and uses other application Web servers for future requests. When an application Web server is down, Oracle Web Cache starts polling the application Web server. It does this by sending requests to the URL specified in the Ping URL field. When Oracle Web Cache is able to successfully get a response from the application Web server without any network errors and the HTTP response code is not less than 100, or equal to 500, 502, 503, 504, it considers that application Web server live again and uses it for future requests.
The default is 10 seconds.
By default, Oracle Web Cache listens with the HTTP protocol on port 1100. It may be necessary to add an additional listening port if you want to assign Oracle Web Cache a port that an application Web server was previously listening on. In addition, you can replace the HTTP listening port to an HTTPS listening port to cache pages for HTTPS requests.
The Oracle Web Cache Listen Ports page appears in the right pane.
The Edit/Create Oracle Web Cache Listen Ports page dialog box appears.
Ensure that this port number is not already in use.
To set resource limits for Oracle Web Cache, configure the following attributes:
When the maximum cache memory limit is reached, Oracle Web Cache performs garbage collection. During garbage collection, Oracle Web Cache removes the less popular and less valid documents from the cache in favor of the more popular and more valid documents.
To avoid swapping documents in and out of the cache, it is crucial to configure enough memory for the cache. Generally, the amount of memory (maximum cache size) for Oracle Web Cache should be set to at least 256 MB. By default, the maximum cache size is set to 500 MB, which is sufficient for most caches.
To be more precise in determining the maximum amount of memory required, you can take the following steps:
One way to do this is to look at existing web server logs for one day to see what documents are popular. From the list of URLs in the log, decide which ones you want to cache. Retrieve the documents and get the size of each document.
The amount of memory that Oracle Web Cache uses to store a document depends on whether the document is larger or smaller than 4 KB:
Use the following formula to determine an estimate of the maximum memory needed:
( X * ( 4KB + 8KB ) ) + ( Y * (( [m/32] * 32KB ) + 8KB )) + 100MB
In the formula:
X
is the number of documents smaller than 4 KB.
4KB
is size of the buffer for the HTTP body for documents smaller than 4 KB.
8KB
is the size of the buffer for the HTTP response header.
Y
is number of documents that are 4 KB or larger.
[
m
/32]
is the ceiling of m
(the average size, in kilobytes, of documents 4 KB or larger) divided by 32
. A ceiling is the closest integer that is greater than or equal to the number.
32KB
is size of the buffer for the HTTP body for documents that are 4 KB or larger.
8KB
is the size of the buffer for the HTTP response header.
100MB
is the base amount, in megabytes, of memory needed to run Oracle Web Cache. This amount includes memory for internal functions such as lookup keys and timestamps.
For example, assume that you want to cache 5000 documents that are smaller than 4 KB and 2000 documents that are 4 KB or larger and that the larger documents have an average size of 54 KB. Use the formula to compute the maximum memory:
(5000 * (4KB + 8KB) ) + ( 2000 * (( [54/32] * 32KB ) + 8KB )) + 100MB
Using the formula, you need:
This results in an estimate of 300 MB of memory needed.
Note that this formula does not take into account the complexities of calculating the size of Edge Side Includes (ESI) pages. The only valid method to calculate the size of pages cached with ESI is to monitor the cache.
To specify the maximum cache size:
The Resource Limits page appears in the right pane.
The Change Maximum Cache Size dialog box appears.
Even though you have specified that certain documents should be cached, not all of the documents are cached at the same time. Only those documents that have been requested and are valid are stored in the cache. As a result, only a certain percentage of your documents are stored in the cache at any given time. That means that you may not need the maximum memory derived by the preceding formula.
Remember that the cache is empty when Oracle Web Cache starts. For monitoring to be valid, make sure that the cache is fully populated. That is, make sure that the cache has received enough requests so that a representative number of documents are cached.
The Oracle Web Cache Statistics and the Oracle Web Cache Detailed Statistics Monitor pages provide information about the current memory use and the maximum memory use.
The Cache Size (in bytes) metric shows the current logical size of the cache. The logical size of the cache is the size of the valid documents in the cache. For example, if the cache contains two documents, one 3 KB and one 50 KB, the cache size is 53 KB, the total of the two sizes. This metric does not show the physical size of the cache.
http://web_cache_hostname:statistics_port
By default, the statistics port is set to port 4002.
The Oracle Web Cache Detailed Statistics Monitor page displays the physical size of the cache. The physical size of the cache is the amount of memory used by Oracle Web Cache.
In the Oracle Web Cache Memory Manager Block Usage table, observe the Current Action Limit and the Current Allocated Memory metrics. The Current Allocated Memory metric is usually smaller than the Current Action Limit metric. If the Current Allocated Memory is close to or greater than the Current Action Limit, increase the maximum cache size.
In addition to the cache size, it is also important to specify the maximum connection limit to the Oracle Web Cache server. When you configure this limit, set a reasonable number. If you set a number that is too high, then performance can be affected. To help determine the correct number, use various tools available with the operating system. For example, the netstat -a
command on UNIX and Windows enables you to determine the number of established connections.
Note that you should set the maximum number of incoming connections in Oracle Web Cache Manager to correctly reflect the maximum number of clients you intend to serve concurrently at any given time. Do not set the value to an arbitrary high value, because Oracle Web Cache sets aside some resources for each connection, adversely affecting performance.
To set the maximum number incoming connections limit:
The Resource Limits page appears in the right pane.
The Change Maximum Incoming Connections Limit dialog box appears.
On most UNIX operating systems, each client connection requires a separate file descriptor. The number of file descriptors that a process can open is usually set to 1024. You can change this number to a higher one, but you must change the ownership of the executable webcached to root and make it executable to all users. In addition, you must add set-user ID permission to the executable. If the ownership of webcached is not changed, Oracle Web Cache fails to start and writes the events to the event_log file.
Oracle Web Cache uses the following formula to calculate the maximum number of file descriptors to be used:
Max_File_Desc = Current_Max_Conn + App_Web_Server_Capacity_Sum + 20
In the formula:
Max_File_Desc
is the maximum number of file descriptors to be used.
Current_Max_Conn
is the current maximum incoming connections limit for Oracle Web Cache. Set the maximum number of incoming connections using the Administering Oracle Web Cache > Resource Limits page of Oracle Web Cache Manager.
App_Web_Server_Capacity_Sum
is the sum of the capacity for all configured application Web Servers. Set the capacity using the Administering Web Sites > Application Web Servers page of Oracle Web Cache Manager.
20
is the number of connections reserved for internal use by Oracle Web Cache.
The Oracle Web Cache server tries to reserve the maximum number of file descriptors (Max_File_Desc
) when it starts. If it fails to do so, it does not default to a lower value but logs an error message and fails to start. If the Oracle Web Cache server fails to start because the number of file descriptors required is more that 1024, you must change the ownership of the executable webcached
to root and make it executable to all users. In addition, you must add set-user ID permission to the executable.
If the ownership of webcached
is not changed, then Oracle Web Cache fails to starts and writes the following events to the event_log
file:
20/May/2001:18:18:24 -0800 -- Error: Could not increase number of file/socket descriptors to 10220. 20/May/2001:18:18:24 -0800 -- Error: Failed to start the server.
See Also:
|
On Windows NT and 2000, the number of file handles as well as socket handles is limited only by available kernel resources, more precisely, by the size of paged and non-paged pools. However, the number of active TCP/IP connections is restricted by the number of TCP ports the system can open.
The default maximum number of TCP ports is set to 5000 by the operating system. Of those, 1024 are reserved by the kernel. You can modify the maximum number of ports by editing the Windows registry. Windows NT and Windows 2000 allow up to 65536 ports.To change the default, you must add a new value to the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Add a new value, specifying the following:
Do not set the maximum number of incoming connections in Oracle Web Cache Manager to a number greater than the number of TCP ports minus 1024. On Windows, Oracle Web Cache does not attempt to reserve file handles or to check that the number of current maximum incoming connections is less than the number of TCP ports.
In addition to receiving HTTP and HTTPS browser request, Oracle Web Cache also receives administration, invalidation, and statistics monitoring requests on specific HTTP or HTTPS listening ports:
http://web_cache_hostname
:http_port
https://web_cache_hostname
:https_port
By default, Oracle Web Cache uses the HTTP protocol to receive these requests. Default port numbers are as follows:
To change the default port number or protocol for administration requests or configuration changes:
The Oracle Web Cache Administration Port page appears in the right pane.
The Change Administration Port dialog box appears.
http://web_cache_hostname
:administration_port
https://web_cache_hostname
:administration_port
When changing the administration port, note the following:
Note:
admin
server process with the webcachectl start
command when performing "Task 8: Restart Oracle Web Cache".
To change the default port number or protocol for invalidation or statistics monitoring requests:
The Oracle Web Cache Invalidation/Statistics Port page appears in the right pane.
The Change Invalidation/Statistics Port dialog box appears.
http://web_cache_hostname
:invalidation_port
https://web_cache_hostname
:invalidation_port
http://web_cache_hostname
:statistics_port
https://web_cache_hostname
:statistics_port
If you configured Oracle Web Cache to receive HTTPS browser requests in Step 2 of "Task 3: Specify Web Site Settings", then create a wallet for server-side certification on the computer running Oracle Web Cache. The wallet manages authentication data such as keys, certificates, and trusted certificates needed by the Secure Sockets Layer (SSL). Once the wallet is created, use Oracle Web Cache Manager to specify the location of the wallet.
This section covers the following topics relating to wallet configuration:
To create the wallet, use Oracle Wallet Manager.
To start Oracle Wallet Manager:
owm
from $ORACLE_HOME/bin
See Also:
Once the wallet is created, use Oracle Web Cache Manager to specify the location of the wallet. You specify the wallet for the Oracle Web Cache computer when you configure listening ports. Listening ports for a site can share the same wallet.
Wallets have the following default locations:
To change the default location of the wallet:
The Oracle Wallet page appears in the right pane.
The Change Oracle Wallet dialog box appears.
On UNIX, use file:
to prefix the directory path. On Windows, use file:
drive_letter
:
to prefix the directory path.
Oracle Web Cache attempts to open wallets at startup on Windows NT and 2000. On Windows NT and 2000, wallets are protected so that only the user that created them can open and use them. By default, Oracle Web Cache services are associated with the local system account, which does not have permission to open wallets.
To enable Oracle Web Cache to open wallets at startup:
The User Rights Policy dialog box appears:
If Users does not exist, create it:
The User Manager window reappears.
Specify the URLs containing the documents you want Oracle Web Cache to cache.
When Oracle Web Cache is configured, stop it and start it again to read in the new configuration settings. When you stop Oracle Web Cache, all objects are cleared from the cache. In addition, all statistics are cleared. You can stop and start Oracle Web Cache using either Oracle Web Cache Manager or the webcachectl
utility on the computer on which Oracle Web Cache software is installed and configured:
Use Oracle Web Cache Manager... | Use the webcachectl Utility... |
---|---|
|
|
|
![]() Copyright © 2001 Oracle Corporation. All Rights Reserved. |
|