MemFS v2 û A Memory-based File System on HP-UX 11i v2
A MemFS instance can be created either through a mount(1) command, or automatically through an
entry in the /etc/fstab file. Creation of a MemFS instance through the mount(2) system call is not
supported.
The syntax for mounting a MemFS instance using the mount(1) command is:
/usr/sbin/mount -F memfs [-eQV] [-o size=<size>] directory
for example, to create a MemFS instance of size 100MB and mounting it on /memfs:
/usr/sbin/mount -F memfs -o size=100MB /memfs
The optional size argument can be used to specify the size of a MemFS instance. Append to size, kb
or KB to indicate the value is in kilobytes, mb or MB to indicate megabytes, or gb or GB to indicate
gigabytes. If the size option is not specified, the default size is computed as the percentage of
maximum buffer cache size that can be occupied by MemFS, as specified by the
memfs_bufcache_swappct tunable.
Tuning the MemFS buffer cache size is very important because MemFS stores data and metadata
there.
The amount of memory in the buffer cache used for MemFS can be tuned using the following dynamic
tunables on HP-UX 11iv2. Both tunables are dynamic tunables and can be modified without a system
reboot.
memfs_bufcache_swappct
is the percentage of buffer cache at which MemFS buffers start swapping.
The default value is 50. The memfs_bufcache_swappct tunable can be as
low as 0 and can be as large as 100. If memfs_bufcache_swappct is set to
0, MemFS data buffers would start swapping immediately to the user
process. If memfs_bufcache_swappct is set to 100, MemFS can occupy the
entire buffer cache before it starts swapping. The larger
memfs_bufcache_swappct is, the greater the amount of buffer cache that
will be reserved for MemFS pages and the better the performance of
MemFS. But, this may adversely impact the performance of other filesystems
that use the buffer cache.
memfs_bufcache_metapct
is the maximum percentage of buffer cache which can accommodate
MemFS metadata of all MemFS instances. The default value is 10. The
memfs_bufcache_metapct tunable cannot be less than 10 and cannot be
greater than 50. Tuning memfs_bufcache_metapct to a value as high as 50
may be necessary if the system primarily uses large MemFS filesystems. The
larger memfs_bufcache_metapct is, the more of the buffer cache will be
reserved for MemFS metadata pages and hence will allow creation of more
and larger MemFS filesystem instances, but impact the performance of
other filesystems that use the buffer cache. Since MemFS metadata pages
can never be swapped out to the user process, exercise caution when
tuning memfs_bufcache_metapct as this may severely impact normal
performance of other filesystems.
MemFS’ behavior is similar to HFS and internally uses the same resources as the HFS filesystem like
mount tables and inode cache. Therefore, tunables like ninode (which specify the maximum number of
HFS file system open inodes that can be in memory) need to be modified appropriately.