Locking Modes Cache Configuration Tuning

10-2 Oracle Fusion Middleware Performance and Tuning Guide Note that Oracle Web Cache is limited by the available addressable memory. Additional memory can increase performance and scalability. For information about the amount of memory needed, see Section 10.2.2, Memory Configuration . Oracle Web Cache has two processes: one for the administration server and one for the cache server. ■ The administration server process is used for configuring and monitoring Oracle Web Cache. This process consumes very little CPU time. However, when viewing the statistics pages in Oracle Web Cache Manager, the administration server process must query the cache server process to obtain the relevant metrics. Accessing the statistics pages frequently, or setting a high refresh rate on a statistics page can affect cache server performance. ■ The cache server process uses three threads: one to manage the front-end activities, a second to manage the back-end activities, and a third to process requests. For a cost-effective way to use Oracle Web Cache, run it on a fast two-CPU dedicated computer with lots of memory. See the Oracle Fusion Middleware Administrators Guide for Oracle Web Cache for information about various deployment scenarios. For a Web site with more than one Oracle Web Cache instance, consider installing each instance on a separate two-CPU node, either as part of a cache cluster or as a standalone instance. When Oracle Web Cache instances are on separate nodes, you are less likely to encounter operating system limitations, particularly in network throughput. For example, two caches on two separate two-CPU nodes are less likely to encounter operating system limitations than two caches on one four-CPU node. Of course, if other resources are competing with Oracle Web Cache for CPU usage, you should take the requirements of those resources into account when determining the number of CPUs needed. Although a separate node for Oracle Web Cache is optimal, you can also derive a significant performance benefit from Oracle Web Cache running on the same node as the rest of the application Web server.

10.2.2 Memory Configuration

To avoid swapping documents in and out of the cache, configure enough memory for the cache. Generally, the amount of memory maximum cache size for Oracle Web Cache should be set to at least 512 MB. Your applications memory requirements can vary based upon factors such document size, number of documents, the number of HTTP headers returned, and whether ESI is present. To get a close approximation on the maximum amount of memory required, you may apply the formula provided below. If your application uses ESI then all templates and document fragments must be accounted for when figuring the TotalDocs and the AvgDocSize. Estimated Cache size in bytes = 1.25 TotalDocs AvgDocSize8192+1 8192+ 16384 ■ 0.25 accounts for the run time memory usage. The Web Cache action limit is set to 5 below than the maximum Web Cache size by default. Web Cache also allocates 5 of the total cache size to optimize access misses that cannot be cached. ■ TotalDocs refers to the total number of documents you intend to place in Web Cache. ■ The AvgDocSize is self-explained. ■ Remember to convert the estimated cache size is returned in bytes by the formula. Oracle Web Cache Performance Tuning 10-3 The memory formula presented above was verified against actual memory usage measurements and it showed very close results as can be seen in the table below:

10.2.2.1 Configuring WebCache Memory

The cache is empty when Oracle Web Cache starts. For monitoring to be valid, ensure that the cache is fully populated. That is, ensure that the cache has received enough requests so that a representative number of documents are cached. The Oracle Web Cache Statistics page Monitoring Web Cache Statistics provides information about the current memory use, the maximum memory use and the total documents currently resident in Oracle Web Cache. Note the following metrics in the Cache Overview table: ■ Size of Documents in Cache shows the current logical size of the cache, which 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 Size of Documents in Cache is 53 KB, the total of the two sizes. ■ Configured Maximum Cache Size indicates the maximum cache size as specified in the Resource Limits page. ■ Current Allocated Memory displays the physical size of the cache, which is the amount of data memory allocated by Oracle Web Cache for cache storage and operation. This number is always smaller than the process size shown by operating system statistics because the Oracle Web Cache process, like any user process, consumes memory in other ways, such as instruction storage, stack data, thread, and library data. ■ Current Action Limit is 95 of the Configured Maximum Cache Size. This number is usually larger than the Current Allocated Memory. If the Current Allocated Memory is greater than the Current Action Limit, Oracle Web Cache begins to use allocated but unused memory, and may begin garbage collection to free more memory. 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 obtain space for new HTTP responses without exceeding the maximum cache size. If the Current Allocated Memory is close to or greater than the Current Action Limit, increase the maximum cache size to avoid swapping documents in and out of the cache. For more information, see Specifying Properties for an Oracle Web Cache System Component in Oracle Fusion Middleware Administrators Guide for Oracle Web Cache. Number of Cached Doc Size In Measured Cache Formula Generated Results Docs Bytes Size in MB Size in MB 3300.00 102400 499.61 499.51 5525.00 51200 499.27 499.08 11050.00 51200 998.54 998.17 6600.00 102400 999.22 999.02 13200.00 102400 1998.44 1998.05 22100.00 51200 1997.07 1996.34 3300.00 102400 499.61 499.51 10-4 Oracle Fusion Middleware Performance and Tuning Guide

10.3 Optimizing Network Connections

■ Network Bandwidth ■ Network Connections ■ Network-Related Parameters

10.3.1 Network Bandwidth

When you use Oracle Web Cache, ensure that each system has sufficient network bandwidth to accommodate the throughput load. Otherwise, the network may be saturated but Oracle Web Cache has additional capacity. For example, if an application generates 100 megabits of data or more per second, 10100 Megabit Ethernet can be saturated. If the network is saturated, consider using Gigabit Ethernet rather than 10100 Megabit Ethernet. Gigabit Ethernet provides the most efficient deployment scenario to avoid network collisions, retransmissions, and bandwidth starvation. Additionally, consider using two separate network cards: one for incoming client requests and one for requests from the cache to the application Web server. Use network-monitoring utilities that show network bandwidth usage. If the network is under utilized and throughput is less than expected, check whether the CPUs are saturated.

10.3.2 Network Connections

It is important to specify a reasonable number for the maximum connection limit for the Oracle Web Cache server. If you set a number that is too high, performance can be affected, resulting in slower response time. If you set a number that is too low, fewer requests can be satisfied. Strike a balance between response time and the number of requests processed concurrently. To help determine a reasonable number, consider the following factors: ■ The maximum number of clients that you intend to serve concurrently at any given time. ■ The average size of a document and the average number of requests per document. ■ Network bandwidth. The amount of data that can be transferred at any one time is limited by the network bandwidth. ■ The percentage of cache misses. Cache misses are forwarded to the application Web server. Those requests consume additional network bandwidth, resulting in longer response times; especially if a large percentage of requests are cache misses. ■ How quickly a document is processed. Use a network monitoring utility, such as ttcp or LoadRunner to determine how quickly your system processes a document. ■ The cache cluster member capacity, if you have a cache cluster environment. The capacity reflects the number of incoming connections from other cache cluster members. Set the cluster member capacity using the Clustering page Properties Clustering of Oracle Web Cache Manager.