Chinaunix首页 | 论坛 | 博客
  • 博客访问: 124960
  • 博文数量: 25
  • 博客积分: 1425
  • 博客等级: 上尉
  • 技术积分: 302
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-22 14:47
个人简介

。。。

文章分类

全部博文(25)

文章存档

2008年(25)

我的朋友

分类:

2008-03-23 01:17:28

ITworld.com, Unix in the Enterprise 11/4/04
Sandra Henry-Stocker, ITworld.com

While not heavily used, options available for UFS file systems can dramatically improve file system performance and stablility. In this week's column, we're going to take a look at how some of these options affect the way file systems operate and why you might consider using them.
 
logging
 
    Logging is one of the most impressive yet relatively overlooked file system feature available on Solaris systems. Introduced in Solaris 7, this option turns a file system into a "journalling" file system. What this means is that the multiple operations that comprise a single file system update -- altering the file's contents, potentially creating or removing its directory entries and updating the data in the file's inode -- are written to a log file before they are actually applied to the file system. This prevents the file systems from suffering from the kind of inconsistencies that have been historically repaired by time-consuming file system checking (a la fsck).
    This is even better than it sounds. Applying the logging option to a UFS file system virtually eliminates file system corruption. This can save you a lot of time and trouble after a messy crash. In the case of a power outage that affects a room full of servers, it may mean you get to go home on time.
    The logging option works so well, in fact, that I and others have enjoyed damage-free reboots even after yanking the power cable from a system during heavy disk activity.
 
noatime
 
    Another incredibly useful UFS option is the noatime (no access time) option. This option removes the requirement that accesses to files be recorded in the access time field in a file's inode. In other words, the file system will ignore access times except when they accompany updates to ctime or mtime. On frequently accessed file systems where this information is of little value -- such as most web sites -- this option can save a tremendous number of file system update operations and significantly improve file system performance.
 
forcedirectio
 
    The forcedirectio (read "force direct IO") UFS option causes data to be buffered in kernel address whenever data is transferred between user address space and the disk. In other words, it bypasses the file system cache. For certain types of applications -- primarily database systems -- this option can dramatically improve performance. In fact, some database experts have argued that a file using the forcedirectio option will outperform a raw partition, though this opinion seems fairly controversial.
    The forcedirectio improves file system performance by eliminating double buffering, providing a small, efficient code path for file system reads and writes and removing pressure on memory.
 
nosuid
 
    The nosuid option disallows the use of suid privilege on any files within the file system, whether or not the suid bits have been turned on. Use of this option adds a small boon to security, since suid programs are sometimes provide the routes through which security holes are created. Use of the nosuid on file systems which house frequently or widely used binaries is especially helpful to deter abuse of the suid feature.
 
ro
 
    The ro (read-only) file system option isn't intended only for mounting CD ROMs. This option can play an important role whenever file systems are shared with client systems, but should not be altered by these clients. For example, if you have built a set of scripts that you want to make available to a large number of systems, you may want to ensure that these scripts cannot be altered by users on remote systems. By sharing the file systems read-only, you can be confident that the scripts cannot be changed by anyone logged into the remote systems.
 
/etc/vfstab
 
    All file system mount options are specified in the /etc/vfstab file (sharing options aree specified in /etc/dfs/dfstab). The logging and noatim options, often used together, would look like this (the line is wrapped):
/dev/dsk/c1d1s0 /dev/rdsk/c1d1s0    /opt/web    ufs    3    yes    logging,noatime
 
    These options will become effective only when the file system is unmounted and then remounted or the system is rebooted. Remounting while the system is still up is, of course, not possible with file systems like / and /usr.
 
 
阅读(852) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~