Tune the proxy server process

You can noticeably improve the performance of Caching Proxy by properly setting up and tuning the system. The following are suggestions for improving setup and tuning.

Set performance-related directives

The following directives significantly affect the performance of the proxy server process:

The following Configuration and Administration form fields edit the values of the associated directives:

Examine other applications

Examine the services or daemons that are running on your system and remove those that are not required to increase available memory and CPU cycles. For example, if your system is running a Web server that serves only a few Web pages, consider using Caching Proxy as your only Web server. Disable other Web servers as follows:

Verify paging space

Ensure that your system has sufficient paging space for proper operation. The system needs twice as much paging space as physical memory. If possible, spread the paging space across multiple physical drives. For example, a Netfinity 5000 server with 512 MB of memory and five SCSI drives needs 1 GB of total paging space with approximately 200 MB on each drive.

Tune the file system

Caching Proxy creates and destroys many files during its operation. If your proxy server records accesses (using the access log, proxy access log, or cache access log), direct the logs to their own file system so that if the logs grow unexpectedly, they do not use space intended for another function (such as the cache).

Tune TCP/IP configuration

Caching Proxy is sensitive to changes to TCP/IP configurations. Lowering the TCP/IP values on any operating system might cause the proxy server to perform in an unexpected manner. More specifically, if the TCP/IP values are set too low, connections might be reset by clients that connect to the proxy server or by origin servers to which the proxy connect. This is especially true for clients that connect to the proxy server through a low bandwidth connection (56700 bps or lower). If TCP/IP parameters must be lowered, proceed with caution.

Tune TCP time wait interval for high-load environments (HP-UX, Linux, Solaris, Windows)

The TCP time wait interval specifies the length of time that a socket waits for a FIN packet from the sender before forcibly closing. In high-load environments, the proxy server may appear to stall if a large number of sockets remain suspended in the TIME_WAIT state after their connections are closed. Reducing the TCP time wait interval will reduce the number of suspended sockets and, in high-load environments, may prevent the proxy server from appearing to stall. It is recommended that this interval be set to 5 seconds.

To set the TCP time wait interval to 5 seconds:

Adjust the Linux kernel

Several limits in the Linux kernel are low and can be modified. Some can be changed through the /proc file system, and others require recompiling the kernel.

Note: The /proc file system is virtual; that is, it does not exist physically on the disk. Instead, it serves as an interface into the Linux kernel. Because it does not exist, your input values are lost on restart. Therefore, place changes that you want to make to the /proc file system in the /etc/rc.d/rc.local file on RedHat or in the /etc/rc.config file on SUSE. Changes are then always activated at restart.

Some recommendations follow:

If you decide to rebuild your kernel, enable only those options that you definitely need. If you do not need a specific daemon, do not run it.

Adjust the AIX thread tuning variables

On AIX systems, Caching Proxy performance can be improved by using system scope threads and allowing multiple heaps to be used by threads. Performance is related to the operating system's multiprocessing ability and the thread scheduling of the underlying operating system. Performance improvement can be achieved by setting the following AIX thread tuning variables as follows:

export AIXTHREAD_SCOPE=S
export SPINLOOPTIME=500
export YIELDLOOPTIME=100
export MALLOCMULTIHEAP=1

You can set these environment variables prior to starting /usr/sbin/ibmproxy or add them to /etc/rc.ibmproxy if you use the startsrc -s ibmproxy command to start the proxy server. Performance improvement is most evident on SMP systems but in some cases improvement might also be evident on uniprocessor systems.

Note:
If multiple heap allocation is enabled, the Caching Proxy runtime process might consume more memory because the memory fragments span multiple heaps. For more information, look to your AIX operating system documentation for details on thread tuning variables.