Analyzing EclipseLink JPA Entity Performance

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. Oracle Web Cache Performance Tuning 10-5 Use various tools, such as those available with the operating system and with Oracle Web Cache, to help determine the maximum number of connections. For example, the netstat-a command enables you to determine the number of established connections; the ttcp utility enables you to determine how fast a document is processed. The Oracle Web Cache Manager provides statistics on hits and misses. For detailed instructions on how to set the maximum number of incoming connections, see Specifying Properties for an Oracle Web Cache System Component in Oracle Fusion Middleware Administrators Guide for Oracle Web Cache.

10.3.3 Network-Related Parameters

Besides the number of network connections, other network-related parameters for Oracle Web Cache, the application Web server, and the operating system can affect response time. In most situations, the default settings are sufficient. If response time is slow, you should tune Oracle Web Cache, the application Web server, and operating system parameters that affect connections, as explained in this section. For Oracle Web Cache, check the values of the following settings: ■ Keep-Alive Timeout The amount of time a network connection is left open after Oracle Web Cache sends a response to a browser. Keep-Alive enables an HTTP client to send multiple requests to Oracle Web Cache using the same network connection. By default, the connection is left open for five seconds, which is typically enough time for the browser to send subsequent requests to Oracle Web Cache using the same connection. If the network between the browser and Oracle Web Cache is slow, consider increasing the timeout, experiment with 10 seconds then 20 seconds and perhaps up to 30 seconds. If you receive the following error, either increase the maximum incoming connections for Oracle Web Cache or lower the Keep-Alive Timeout: 11313: The cache server reached the maximum number of allowed incoming connections. Listening is temporarily suspended. With a heavy load, such as during stress-testing, if clients continuously send one request and then disconnect, set the Keep-Alive Timeout to 0. With this value, Oracle Web Cache closes the connection as soon as the request is completed, to free up resources. Set the Keep-Alive Timeout value in the Network Timeouts page Properties Network Timeouts. ■ Origin Server Timeout The amount of time for the application Web server to generate a response to Oracle Web Cache. If the application Web server or proxy server is unable to WARNING: Do not set the values listed above to an arbitrarily high value. Oracle Web Cache sets aside some resources such as memory for each connection. Altering these values can adversely affect performance. 10-6 Oracle Fusion Middleware Performance and Tuning Guide generate a response within that time, Oracle Web Cache sends a network apology page to the browser. Usually, this value should be equal to the response time of the slowest document served by the application Web Server. If the value is too low, long-running requests can timeout before the response is complete. If the value is too high and the application Web server hangs for some reason, it can take longer for Oracle Web Cache to failover to another application Web server. Set this value in the Network Timeouts page Properties Network Timeouts. For the application Web server, check the values of the following settings in the application Web servers configuration file httpd.conf. These particular parameter names are specific to the Oracle HTTP Server. ■ KeepAlive Whether to allow persistent connections. Persistent connections allow a client to send multiple sequential requests through the same connection. Make sure KeepAlive is enabled. This can improve performance because the connection is set up only once and is kept open for subsequent requests from the same client. ■ KeepAliveTimeout: The time a connection is left open to wait for the next request from the same client. If requests are primarily from Oracle Web Cache, you can set this value fairly high. A reasonable value is 30 seconds. ■ MaxKeepAliveRequests: The maximum number of requests to allow during a persistent connection. Set to 0 to allow an unlimited number of requests. ■ MaxClients: The maximum number of clients that can connect to the application Web server simultaneously. If KeepAlive is enabled for the application Web server, you may require more concurrent httpd server processes, and you may have to set the MaxClients directive to a higher value. If client requests have a short response time, you may be able to improve performance by setting MaxClients to a lower value. However, when the MaxClients value is reached, no additional processes can be created, causing other requests to fail. The MaxClients limit on the application Web server should be greater than or equal to the application Web server capacity as set through the Oracle Web Cache Manager. For the operating system, check the TCP time-wait setting. This setting controls the amount of time that the operating system holds a port, not allowing new connections to use the same port. On the Linux operating system, validate the value of procsysnetipv4tcp_ fin_timeout. On the Solaris Operating System, check the tcp_time_wait_ interval setting, using the following command: ndd -get devtcp tcp_time_wait_interval. On Windows, check the value of TcpTimeWaitDelay in the following key in the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters This setting is usually only an issue during stress testing, if you continuously open more TCPIP connections from one client computer. In this situation, lower the