Specifying the maximum number of files that can be created

The maximum number of files that can be created can be specified by using the --inode-limit option on the mmcrfs command and the mmchfs command.

Allowable values, which range from the current number of created inodes (determined by issuing the mmdf command with the -F option) through the maximum number of files that are supported, are constrained by the formula:
maximum number of files = (total file system space) / (inode size + subblock size)

You can determine the inode size (-i) and subblock size (value of the -B parameter / 32) of a file system by running the mmlsfs command. The maximum number of files in a file system may be specified at file system creation by using the --inode-limit option on the mmcrfs command, or it may be increased at a later time by using --inode-limit on the mmchfs command. This value defaults to the size of the file system at creation divided by 1 MB and cannot exceed the architectural limit. When a file system is created, 4084 inodes are used by default; these inodes are used by GPFS™ for internal system files.

For more information, see mmcrfs command and mmchfs command.

The --inode-limit option applies only to the root fileset. When there are multiple inode spaces, use the --inode-space option of the mmchfileset command to alter the inode limits of independent filesets. The mmchfileset command can also be used to modify the root inode space. The --inode-space option of the mmlsfs command shows the sum of all inode spaces.

Inodes are allocated when they are used. When a file is deleted, the inode is reused, but inodes are never deallocated. When setting the maximum number of inodes in a file system, there is the option to preallocate inodes. However, in most cases there is no need to preallocate inodes because, by default, inodes are allocated in sets as needed. If you do decide to preallocate inodes, be careful not to preallocate more inodes than will be used; otherwise, the allocated inodes will unnecessarily consume metadata space that cannot be reclaimed.

These options limit the maximum number of files that may actively exist within a file system. However, the maximum number of files in the file system may be restricted further by GPFS so the control structures associated with each file do not consume all of the file system space.

Further considerations when managing inodes:
  1. For file systems that are supporting parallel file creates, as the total number of free inodes drops below 5% of the total number of inodes, there is the potential for slowdown in file system access. Take this into consideration when creating or changing your file system. Use the mmdf command to display the number of free inodes.
  2. Excessively increasing the value for the maximum number of files may cause the allocation of too much disk space for control structures.