Sun Microsystems Logo
Products and Services
 
Support and Training
 
 

Previous Previous     Contents     Index     Next Next
Chapter 2

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 is 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 NCA 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.

New NCA Functionality

This release now provides support for a web server to open multiple AF-NCA sockets. With multiple sockets, you can have different web servers that run on one server.

In addition, a new configuration file that is called /etc/nca/ncaport.conf is available. The file can be used to manage the IP addresses and ports that NCA uses. Your web server might not provide native support of the AF_NCA socket. If your server lacks this support, use this file and the NCA socket utility library to convert an AF_INET socket to an AF_NCA socket.

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 issues to be resolved before you enable the use of NCA.

Planning for NCA

Enabling NCA

Steps to enable in-kernel caching of web pages on a web server.

How to Enable Caching of Web Pages

Disabling NCA

Steps to disable in-kernel caching of web pages on a web server.

How to Disable Caching of Web Pages

Administering NCA logging

Steps to enable or disable the NCA logging process.

How to Enable or Disable NCA Logging

Loading the NCA socket library

Steps to use NCA if the AF_NCA socket is not supported.

How to Load the Socket Utility Library for NCA

Planning for NCA

The following sections cover the issues that need to be resolved before starting the NCA 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. The running of other large processes on a server that runs NCA can cause problems.

NCA Logging

The NCA service can be configured to log web activity. Generally, NCA logging should be enabled if the web server logging is enabled.

Interpositioning Library for Daemon Support of the Door Server

Many web servers use AF_INET sockets. By default, NCA uses AF_NCA sockets. To correct this situation, an interpositioning library is provided. The new library is loaded in front of the standard socket library, libsocket.so. The library call bind() is interposed by the new library, ncad_addr.so. Suppose that the status is enabled in /etc/nca/ncakmod.conf. The version of Apache that is included with the Solaris 9 release is already set up to call this library. If you are using IWS or Netscape servers, see How to Load the Socket Utility Library for NCA to use the new library.

Multiple Instance Support

Systems that have NCA installed often need to run multiple instances of a web server. For instance, a single server might need to support a web server for outside access as well as a web administration server. To separate these servers, you would configure each server to use a separate port.

Administering the Caching of Web Pages (Tasks)

The following sections cover the procedures to enable or disable parts of the service.

ProcedureHow to Enable Caching of Web Pages

  1. Become superuser.

  2. 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.

  3. 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

    See the ncakmod.conf(4) man page for more information.

  4. (Optional) 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.

  5. (Optional) Define ports for multiple instance support.

    Add the port numbers in the /etc/nca/ncaport.conf file. This entry causes NCA to monitor port 80 on all configured IP addresses.

    # cat /etc/nca/ncaport.conf
    #
    # NCA Kernel Module Port Configuration File
    #
      .
      .
    ncaport=*/80

  6. 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 - By setting the kernelbase, you reduce the amount of virtual memory that user processes can use to less than 3 Gbytes. This restriction means that the system is not ABI compliant. When the system boots, the console 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 the program on a system that does not have NCA enabled.


  7. Reboot the server.

Previous Previous     Contents     Index     Next Next