System Administration Guide, Volume 3

Solaris Network Cache and Accelerator (NCA)

The Solaris Network Cache and Accelerator, NCA, increases web server performance by maintaining an in-kernel cache of web pages accessed during HTTP requests. NCA provides full HTTP support in the kernel by either handling the request or passing it to the web server for processing.

This product is intended to be run on a dedicated web server. Running other large processes on a server running NCA can cause problems.

The NCA feature requires two components.

ncakmod communicates with a web server, httpd, through a Solaris door (see door_create(3DOOR)). The Solaris doors library offers a fast reliable synchronous RPC mechanism between processes on the same host and between the kernel and a user space process.

ncakmod to httpd protocol is a synchronous, request-response protocol using the Solaris doors remote procedure call (RPC) interface. Door RPC calls originate in the kernel in the NCA and are synchronous. Data is transfered in both directions; that is, from the NCA to the http server and from the http server to the NCA in each door RPC. ncakmod passes HTTP requests to httpd. httpd returns a response to the request over the doors interface. This provides functionality similar to features such as acceptx and sendfile.

NCA logging writes HTTP request data to the disk in binary format. The NCA feature supports the CLF (common log format) log file format.

Table 2-2 Solaris NCA Administration Task Map

Task 

Description 

For Instructions, Go To ... 

Enabling NCA 

 Steps to enable in-kernel caching of web pages on a web server."How to Enable NCA"

Disabling NCA 

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

"How to Disable NCA"

Changing NCA logging 

Steps to enable or disable the NCA logging process. 

"How to Enable or Disable NCA Logging"

How to Enable NCA

  1. Become superuser.

  2. Register the interfaces.

    Enter 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

    For each interface, there must be an accompanying hostname.interface-name file and an entry in /etc/hosts file for the contents of hostname.interface-name. To bring up 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
    #
    # Copyright (c) 1998-1999 by Sun Microsystems, Inc.
    # All rights reserved.
    #
    #ident  "@(#)ncakmod.conf       1.1     99/08/06 SMI"
    #
    # NCA Kernel Module Configuration File
    #
    status=enabled
    httpd_door_path=/var/run/nca_httpd_1.door

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

  4. Enable NCA logging.

    Change the status entry in /etc/nca/ncalogd.conf to enabled.


    # cat /etc/nca/ncalogd.conf
    #
    # Copyright (c) 1998-1999 by Sun Microsystems, Inc.
    # All rights reserved.
    #
    #ident  "@(#)ncalogd.conf       1.1     99/08/06 SMI"
    #
    # NCA Log Daemon 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 indicted by the logd_path_name entry. See the ncalogd.conf(4) man page for more information.

  5. For IA only: Increase the virtual memory size.

    Use the eeprom command to set the kernelbase of the system.


    # eeprom kernelbase=0x900000000
    # eeprom kernelbase
    kernelbase=0x900000000

    The second command verifies that the parameter has been set.


    Note -

    This reduces the amount of virtual memory that is available to user processes to less than 3 Gbytes, which means that the system is not ABI-compliant. When the system boots, it will display a message warning you about non-compliance. Most programs do not actually need the full 3 Gbyte virtual address space. If you have a program that does, you need to run it on a system that does not have NCA enabled.


  6. Reboot the server.

How to Disable NCA

  1. Become superuser.

  2. Disable the ncakmod kernel module.

    Change the status entry in /etc/nca/ncakmod.conf to disabled.


    # cat /etc/nca/ncakmod.conf
    #
    # Copyright (c) 1998-1999 by Sun Microsystems, Inc.
    # All rights reserved.
    #
    #ident  "@(#)ncakmod.conf       1.1     99/08/06 SMI"
    #
    # NCA Kernel Module Configuration File
    #
    status=disabled
    httpd_door_path=/var/run/nca_httpd_1.door

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

  3. Disable NCA logging.

    Change the status entry in /etc/nca/ncalogd.conf to disabled.


    # cat /etc/nca/ncalogd.conf
    #
    # Copyright (c) 1998-1999 by Sun Microsystems, Inc.
    # All rights reserved.
    #
    #ident  "@(#)ncalogd.conf       1.1     99/08/06 SMI"
    #
    # NCA Log Daemon Configuration File
    #
    status=disabled
    logd_path_name="/var/nca/log"
    logd_file_size=1000000

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

  4. Reboot the server.

How to Enable or Disable NCA Logging

NCA log processing can be turned on or off as needed once NCA has been enabled (see "How to Enable NCA" for more information.)

  1. Become superuser.

  2. Change NCA log processing.

    To permanently disable logging you need to change the status in /etc/nca/ncalogd.conf to disabled and reboot the system. See the ncalogd.conf(4) man page for more information.

    1. To stop logging:

      Type the following command.


      # /etc/init.d/ncalogd stop
      
    2. To start logging:

      Type the following command.


      # /etc/init.d/ncalogd start
      

NCA Files

You need several files to support the NCA feature. Many of these files are ASCII, but some of them are binary. The table below lists all of the files.

Table 2-3 NCA Files

File Name 

Function 

/etc/hostname.*

Lists all physical interfaces configured on the server. 

/etc/hosts

Lists all host names associated with the server. Entries in this file must match with entries in /etc/hostname.* files for NCA to function.

/etc/init.d/ncalogd

NCA startup script run when a server is booted. 

/etc/nca/nca.if

Lists the interfaces on which NCA is run (see the nca.if(4) man page).

/etc/nca/ncakmod.conf

Lists configuration parameters for NCA (see the ncakmod.conf(4) man page).

/etc/nca/ncalogd.conf

Lists configuration parameters for NCA logging (see the ncalogd.conf(4) man page).

/usr/bin/ncab2clf

Command used to convert data in the log file to Common Log File format (see the ncab2clf(1) man page).

/var/nca/log

Holds log file data; in binary format so do not edit this file.