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

File Cache Dynamic Control and Monitoring

You can add an object to obj.conf to dynamically monitor and control the nsfc.conf file cache while the server is running.

ProcedureTo add an object to obj.conf

  1. Add a NameTrans directive to the default object:

    NameTrans fn="assign-name" from="/nsfc" name="nsfc"

  2. Add an nsfc object definition:

    <Object name=”nsfc”> Service fn=service-nsfc-dump </Object>

    This enables the file cache control and monitoring function (nsfc-dump) to be accessed through the URI, "/nsfc." By changing the "from" parameter in the NameTrans directive, a different URI can be used.

    The following is an example of the information you receive when you access the URI:

    Sun Java System Web Server File Cache Status (pid 7960)
    The file cache is enabled.
     Cache resource utilization
    Number of cached file entries = 1039 (112 bytes each, 116368 total
    Heap space used for cache = 237641/1204228 bytes
    Mapped memory used for medium file contents = 5742797/10485760 bytes
    Number of cache lookup hits = 435877/720427 ( 60.50 %)
    Number of hits/misses on cached file info = 212125/128556
    Number of hits/misses on cached file content = 19426/502284
    Number of outdated cache entries deleted = 0
    Number of cache entry replacements = 127405
    Total number of cache entries deleted = 127407
    Number of busy deleted cache entries = 17
    Parameter settings
    HitOrder: false
    CacheFileInfo: true
    CacheFileContent: true
    TransmitFile: false
    MaxAge: 30 seconds
    MaxFiles: 1024 files
    SmallFileSizeLimit: 2048 bytes
    MediumFileSizeLimit: 537600 bytes
    CopyFiles: false
    Directory for temporary files: /tmp/netscape/
    Hash table size: 2049 buckets

    You can include a query string when you access the "/nsfc" URI. The following values are recognized:

    • ?list: Lists the files in the cache.

    • ?refresh=n: Causes the client to reload the page every n seconds.

    • ?restart: Causes the cache to be shut down and then restarted.

    • ?start: Starts the cache.

    • ?stop: Shuts down the cache.

      If you choose the ?list option, the file listing includes the file name, a set of flags, the current number of references to the cache entry, the size of the file, and an internal file ID value. The flags are as follows:

    • C: File contents are cached.

    • D: Cache entry is marked for delete.

    • E: PR_GetFileInfo() returned an error for this file.

    • I: File information (size, modify date, and so on) is cached.

    • M: File contents are mapped into virtual memory.

    • O: File descriptor is cached (when TransmitFile is set to true).

    • P: File has associated private data (should appear on shtml files).

    • T: Cache entry has a temporary file.

    • W: Cache entry is locked for write access.

      For sites with scheduled updates to content, consider shutting down the cache while the content is being updated, and starting it again after the update is complete. Although performance will slow down, the server operates normally when the cache is off.