Memory File System (MemFS) 2.
© Copyright 2009 Hewlett-Packard Development Company L.P Legal Notices Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license. The information contained herein is subject to change without notice.
Table of Contents About This Document.....................................................................................................................7 Intended Audience...............................................................................................................7 Document Organization.......................................................................................................7 Typographic Conventions............................................................................
List of Figures 1-1 2-1 4 MemFS Architecture...................................................................................................12 Memory Report...........................................................................................................
List of Tables 1 2 Document Organization...............................................................................................7 Typographic Conventions.............................................................................................
About This Document The Memory File System (MemFS) 2.0 for HP-UX 11i v3 Administrator’s Guide describes how to install, configure, and tune MemFS on HP-UX 11i v3. Intended Audience This document is for system administrators responsible for installing and configuring MemFS on HP-UX 11i v3. Readers are expected to have knowledge of: • HP-UX System administration concepts • • UNIX® operating system concepts UNIX File system concepts Document Organization The Memory File System (MemFS) 2.
Table 2 Typographic Conventions (continued) Typeface Usage Examples # Superuser prompt (all shells) Not applicable \ Continued input on the following line; you do not type this character # mount -F vxfs \ /h/filesys [ ] In command synopsis, brackets indicates an ls [ -a ] optional argument. | In command synopsis, a vertical bar separates mount [ suid | nosuid ] mutually exclusive arguments.
1 Introducing HP-UX Memory File System (MemFS) 2.0 This chapter introduces you to the HP-UX implementation of Memory File System (MemFS). The following topics are discussed: • • • • • Overview Need for a Memory-Based File System Architecture of HP-UX Memory File System Application Areas for HP-UX Memory File System Dependencies 1.1 Overview A Memory-based File System (MemFS) is a file system that resides in memory. It does not normally write data out to stable storage.
implement a "delayed write" mechanism. Using a buffer helps the file systems avoid disk I/O to some extent and improve the file system performance. Structural and attribute changes are buffered to a lesser extent, and will usually cause disk I/O to be done. A memory-based file system goes a bit further to avoid disk I/O. Metadata is always kept in memory, so the overhead of writing structural changes to the disk is totally avoided.
new layout, which stores file data in the UFC (Unified File Cache) and metadata in the kernel memory. It does not use the user process address space as backing store for the files data, during memory pressure. It has all the features needed for a basic file system. Some of the more advanced file system features (e.g. journaling, un-buffered I/O) that some of the contemporary file systems provide are neither required nor relevant in the context of a memory file system.
is a need to wisely use these shared resources. MemFS provides the following tunables to limit the usage exclusively by MemFS: • memfs_metamax Tunable to limit the amount of kernel memory used by MemFS • memfs_swapmax Tunable to limit the amount of swap space used by MemFS For more details on these tunables, see Chapter 2: “Installing, Configuring, Tuning, and Removing HP-UX Memory File System” (page 15). Figure 1-1 MemFS Architecture 1.
• • • • • • PHCO_38751 PHCO_38752 PHCO_39038 PHCO_39039 PHKL_38077 PHKL_38949 These patches are available at the following location: http://itrc.hp.com Without these patches, MemFS cannot be installed. MemFS product should not be installed with -x enforce_dependencies=false option of swinstall(1m). 1.
2 Installing, Configuring, Tuning, and Removing HP-UX Memory File System This chapter describes how to install, configure, tune and remove HP-UX Memory File System (MemFS). The following topics are discussed: • • • • Installing HP-UX Memory File System Configuring Memory File System Tuning Memory File System Removing Memory File System 2.1 Installing HP-UX Memory File System You can install HP-UX Memory File System (MemFS) either non-interactively or interactively. 2.1.
mount -F memfs -o size=100MB,ninode=500,mode=0777,user=20,group=40 /mnt For example, to automatically mount after system reboot, a MemFS instance of size 50MB with 1000 inodes on a mount point, /mnt with permissions set to 0777, owning user as user with ID 20 and owning group as group with ID 40, add the following entry to /etc/fstab file: memfs /mnt memfs size=50MB,ninode=1000,mode=0777,user=20,group=40 0 0 The optional size argument can be used to specify the size of a MemFS instance.
# /usr/sbin/umount /memfs 2.2 Tuning Memory File System MemFS uses kernel memory for storing the file's metadata. Kernel memory is shared by all the subsystems in the kernel and this memory is not page-able. Over-use of kernel memory can bring down the performance of the system as well as the applications that compete for kernel memory. MemFS provides a tunable called memfs_metamax to restrict the amount of kernel memory used by all MemFS instances.
M=1000000, MB=(1024*1024), and GB=(1024*1024*1024). For example, a constant value could be 500K. Example: kctune -s memfs_metamax=100MB If MemFS utilizes all the memory specified by this tunable, mounting of new MemFS file systems and creation of new files on them will fail and following message will be displayed on console: memfs: metadata exceeds memfs_metamax This tunable can be modified dynamically.
system fails with error [ENOSPC] when the swap usage has reached the limit; in addition, the following message will be displayed on the console: memfs: Cumulative data exceeds memfs_swapmax_pct This tunable can be modified dynamically. If the new limit specified is less than the swap space in use by MemFS (for example 10%), following warning will be displayed on console: Warning: The specified value of tunable memfs_swapmax_pct is less than the percentage of swap space currently in use by MemFS, 10 percent.
2.2.3.2 GlancePlus GlancePlus, C.04.70.000 provides MemFS details similar to sar(1M) command. The Memory Report page shows the number of 4KB blocks of MemFS in memory and swap. Figure 2-1 Memory Report 2.3 Removing Memory File System To remove MemFS, enter the following command: # swremove -x autoreboot=true MemFS 2.4 Known Problems and Other Limitations 2.4.
• recommends that you not use MemFS to mount /tmp and any file systems which contain critical data that require consistency. A limitation with MemFS and Ignite-UX (and other products) is that there is no support for /tmp or for /var/tmp as MemFS file systems. MemFS file systems should be used only to hold application transient files. The file system and all its contents will be lost with an unmount or reboot operation.