Sun Java System Web Server 6.1 SP9 Performance Tuning, Sizing, and Scaling Guide

Configuring the File Cache

The file cache is turned on by default. The file cache settings are contained in a file called nsfc.conf. You can use the Server Manager to change the file cache settings. For more information about nsfc.conf, see the Sun Java System Web Server 6.1 SP9 Administrator’s Configuration File Reference.

ProcedureTo configure the cache

  1. From the Server Manager, select the Preferences tab.

  2. Select File Cache Configuration.

  3. Select Enable File Cache, if not already selected.

  4. Choose whether to transmit files.

    When you enable Transmit File, the server caches open file descriptors for files in the file cache, rather than the file contents, and PR_TransmitFile is used to send the file contents to a client. When Transmit File is enabled, the distinction normally made by the file cache between small, medium, and large files no longer applies, since only the open file descriptor is being cached. By default, Transmit File is enabled on Windows, and disabled on UNIX. On UNIX, only enable Transmit File for platforms that have native OS support for PR_TransmitFile, which currently includes HP-UX and AIX. It is not recommended for other UNIX/Linux platforms.

  5. Enter a size for the hash table.

    The default size is twice the maximum number of files plus 1. For example, if your maximum number of files is set to 1024, the default hash table size is 2049.

  6. Enter a maximum age in seconds for a valid cache entry.

    By default, this is set to 30.

    This setting controls how long cached information will continue to be used once a file has been cached. An entry older than MaxAge is replaced by a new entry for the same file, if the same file is referenced through the cache.

    Set the maximum age based on whether the content is updated (existing files are modified) on a regular schedule. For example, if content is updated four times a day at regular intervals, you could set the maximum age to 21600 seconds (6 hours). Otherwise, consider setting the maximum age to the longest time you are willing to serve the previous version of a content file after the file has been modified.

  7. Enter the Maximum Number of Files to be cached.

    By default, this is set to 1024.

  8. (UNIX/Linux only) Enter medium and small file size limits in bytes.

    By default, the Medium File Size Limit is set to 537600.

    By default, the Small File Size Limit is set to 2048.

    The cache treats small, medium, and large files differently. The contents of medium files are cached by mapping the file into virtual memory (currently only on UNIX/Linux platforms). The contents of small files are cached by allocating heap space and reading the file into it. The contents of large files (larger than medium) are not cached, although information about large files is cached.

    The advantage of distinguishing between small files and medium files is to avoid wasting part of many pages of virtual memory when there are lots of small files. So the Small File Size Limit is typically a slightly lower value than the VM page size.

  9. (UNIX/Linux only) Set the medium and small file space.

    The medium file space is the size in bytes of the virtual memory used to map all medium sized files. By default, this is set to 10485760.

    The small file space is the size of heap space in bytes used for the cache, including heap space used to cache small files. By default, this is set to 1048576 for UNIX/Linux.

  10. Click OK, and then click Apply.

  11. Select Apply Changes to restart your server and put your changes into effect.