HP-UX Reference (11i v2 07/12) - 5 Miscellaneous (vol 9)

n
nle(5) nle(5)
(Tunable Kernel Parameters)
NAME
nfile - maximum number of open files (system-wide)
VALUES
Failsafe
16384
Default
The default value is computed at runtime and depends on the amount of physical memory on the system.
For small memory systems (less than 1GB), the default is 16384, or 16K. For systems with more than 1GB
of memory, the default is 65536, or 64K.
Allowed values
The minimum value allowed is 2048. The maximum value allowed is the maximum 32-bit signed integer
value that can be represented in the system. The value is further constrained in that it must be equal to or
greater than two times the per-process open file hard limit:
(nfile >= 2*maxfiles_lim)
.
Specify a positive integer value.
DESCRIPTION
The
nfile tunable defines the maximum number of slots in the system open file table. This number lim-
its the cumulative number of open files by all processes in the system. In addition to named files (regular
files, directories, links, device files, etc.), other objects that consume slots in the system open file table
include pipes, FIFOs, sockets, streams. Be aware that the dup(2) and dup2(2) system calls, while they con-
sume entries in the per-process file tables, they do not consume new slots in the system open file table.
Who Is Expected to Change This Tunable?
Anyone expecting to run applications with large numbers of open files.
Restrictions on Changing
This tunable is dynamic (tuning will take effect immediately on the running system). When the value of
nfile is dynamically tuned it cannot be set to a value lower than the number of current open files in the
running kernel.
When Should the Value of This Tunable Be Raised?
This tunable value should be increased when large numbers of files are expected to be open simultaneously
by several processes. Be generous with this number because the required memory is minimal, and not hav-
ing enough slots restricts system processing capacity.
What are the Side Effects of Raising the Value?
There is no immediate side effect of raising nfile. However, as the system file table is populated when
files are opened additional memory will be consumed. Raising the value of nfile implicitly allows the sys-
tem file table to consume more memory.
When Should the Value of This Tunable Be Lowered?
The value of this tunable rarely needs to be lowered. The value can be lowered to limit the number of open
files on a system and this may reduce memory consumption.
What are the Side Effects of Lowering the Value?
Lowering the value of
nfile may result on the kernel returning some memory back to the system pool.
What Other Tunable Values Should Be Changed at the Same Time?
nfile must be equal to or greater than two times the value of maxfiles_lim . Kernel checks during
tunable setting ensure this.
WARNINGS
All HP-UX kernel tunable parameters are release specific. This parameter may be removed or have its
meaning changed in future releases of HP-UX.
Installation of optional kernel software, from HP or other vendors, may cause changes to tunable parame-
ter values. After installation, some tunable parameters may no longer be at the default or recommended
values. For information about the effects of installation on tunable values, consult the documentation for
the kernel software being installed. For information about optional kernel software that was factory
HP-UX 11i Version 2: December 2007 Update 1 Hewlett-Packard Company 267