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.
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 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:
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.
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).
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.
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:
Issue the following command:
ndd /dev/tcp -set tcp_time_wait_interval 5000
Use the "sam" utility to set the kernel parameter max_thread_proc to at least 2048.
Issue the following commands:
echo "1024 61000" > /proc/sys/net/ipv4/ip_local_port_range echo "5" > /proc/sys/net/ipv4/tcp_fin_timeout
Issue the following command:
ndd /dev/tcp -set tcp_time_wait_interval 5000
Edit the /etc/system file to read as follows::
set tcp:tcp_conn_hash_size=8129
A registry entry must be created set a TCP time wait interval. Refer to your Windows documentation for more information.
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:
echo 32768 > /proc/sys/fs/file-max
echo 65536 > /proc/sys/fs/inode-max
echo 32768 61000 > /proc/sys/net/ipv4/ip_local_port_range
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.
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.