The directory name look-up cache (DNLC) is enhanced to provide improved performance when you access files in large directories with 1000 or more files.
The DNLC is a general file-system service that caches the most recently referenced directory names and their associated vnodes. UFS directory entries are stored linearly on disk. This means that locating an entry requires searching each entry for the name. Adding a new entry requires searching the entire directory to ensure the name does not exist. To solve this performance problem, entire directories are cached in memory by the DNLC.
Another feature in this release is DNLC caching of file objects that have been looked up, but do not exist. This feature is known as negative caching, and is useful because some applications repeatedly test to check if a file exists.
The section that follows describes the new DNLC tunable parameters. These parameters are set optimally and should not be changed casually.
MAXUINT is the maximum value of an unsigned integer.
Enables large directory caching
Unsigned integer
1 (enabled)
0 (disabled), 1 (enabled)
Directory caching has no known problems, but if problems occur, set dnlc_dir_enable to 0 to disable caching.
Minimum number of entries cached for one directory
Unsigned integer
40
0 to MAXUINT (no maximum)
If performance problems occur with caching small directories, increase dnlc_dir_min_size. Note that individual file systems might have their own range limits for caching directories. For instance, UFS limits directories to a minimum of ufs_min_dir_cache bytes (approximately 1024 entries), assuming 16 bytes per entry.
Maximum number of directory entries before caching
Unsigned integer
MAXUINT (no maximum)
0 to MAXUINT
If performance problems occur with large directories, decrease dnlc_dir_max_size.