Managing Web Cache Servers
This chapter provides an overview of the Solaris Network Cache and Accelerator (NCA). Also, procedures for using NCA and reference material about NCA are included.
Network Cache and Accelerator (Overview)
The Solaris Network Cache and Accelerator (NCA) increases web server performance by maintaining an in-kernel cache of web pages that are accessed during HTTP requests. This in-kernel cache uses system memory to significantly increase performance for HTTP requests that are normally handled by web servers. Using system memory to hold web pages for HTTP requests increases web server performance by reducing the overhead between the kernel and the web server. NCA provides a sockets interface through which any web server can communicate with NCA with minimal modifications.
In situations where the requested page is retrieved from the in-kernel cache (cache hit), performance improves dramatically. In situations where the requested page in not in the cache (cache miss) and must be retrieved from the web server, performance is also significantly improved.
This product is intended to be run on a dedicated web server. If you run other large processes on a server that runs NCA, problems can result.
NCA provides logging support in that it logs all cache hits. This log is stored in binary format to increase performance. The ncab2clf command can be used to convert the log from binary format to common log format (CLF).
The Solaris 9 release includes the following enhancements:
Sockets interface.
Support for vectored sendfile, which provides support for AF_NCA. See the sendfilev(3EXT) man page for more information.
New options for the ncab2clf command that support the ability to skip records before a selected date (-s) and to process a specified number of records (-n).
logd_path_name in ncalogd.conf can specify either a raw device, a file, or a combination of the two.
Managing Web Cache Servers (Task Map)
The following table describes the procedures that are needed to use NCA.
Task | Description | For Instructions |
---|---|---|
Planning for NCA | A list of requirements to enable the use of NCA. Review before configuring NCA. | |
Enabling NCA | Steps to enable in-kernel caching of web pages on a web server. | |
Disabling NCA | Steps to disable in-kernel caching of web pages on a web server. | |
Administering NCA logging | Steps to enable or disable the NCA logging process. | |
Loading the NCA socket library | Steps to use NCA if the AF_NCA socket is not supported. |
Administering the Caching of Web Pages (Tasks)
The following sections cover the system requirements that are needed to use NCA and the procedures to enable or disable parts of the service.
System Requirements for NCA
To support NCA, the system must meet these requirements:
256 Mbytes RAM must be installed.
The Solaris 9 release or one of the Solaris 8 upgrade releases must be installed.
Apache support must be available. Apache support is available in the Solaris 9 and the Solaris 8 upgrade releases.
This product is intended to be run on a dedicated web server. Running other large processes on a server that runs NCA can cause problems.
How to Enable Caching of Web Pages
Become superuser.
Register the interfaces.
Type the names of each of the physical interfaces in the /etc/nca/nca.if file. See the nca.if(4) man page for more information.
# cat /etc/nca/nca.if hme0 hme1
Each interface must have an accompanying hostname.interface-name file and an entry in /etc/hosts file for the contents of hostname.interface-name. To start the NCA feature on all interfaces, place an asterisk, *, in the nca.if file.
Enable the ncakmod kernel module.
Change the status entry in /etc/nca/ncakmod.conf to enabled.
# cat /etc/nca/ncakmod.conf # # NCA Kernel Module Configuration File # status=enabled httpd_door_path=/var/run/nca_httpd_1.door nca_active=disabled
Enable NCA logging.
Change the status entry in /etc/nca/ncalogd.conf to enabled.
# cat /etc/nca/ncalogd.conf # # NCA Logging Configuration File # status=enabled logd_path_name="/var/nca/log" logd_file_size=1000000
You can change the location of the log file by changing the path that is indicated by the logd_path_name entry. The log file can be a raw device or a file. See the following examples for samples of NCA log file paths. See the ncalogd.conf(4) man page for more information about the configuration file.
For IA only: Increase the virtual memory size.
Use the eeprom command to set the kernelbase of the system.
# eeprom kernelbase=0x90000000 # eeprom kernelbase kernelbase=0x90000000
The second command verifies that the parameter has been set.
Note - Setting the kernelbase of the system reduces the amount of virtual memory that user processes can use to less than 3 Gbytes, which means that the system is not ABI compliant. When the system boots, it displays a message that warns you about noncompliance. Most programs do not actually need the full 3-Gbyte virtual address space. If you have a program that needs more than 3 Gbytes, you need to run it on a system that does not have NCA enabled.
Reboot the server.