在一个文档里面看到这么一段话，言简意赅的说明了为什么使用raw devices还是file system?
Raw Logical Volumes vs. File Systems
Within the database community, there has been a long running debate surrounding the use of raw logical volumes (raw devices) versus file systems. Advocates of raw logical volumes stress the performance gains that can be realized through their use, whereas file system supporters emphasize the ease of use and manageability features of file systems. As with the other aspects of system design, a decision must be made as to which is more important: performance or manageability.
To understand the performance advantages associated with raw logical volumes better, it is helpful to have an understanding of the impact of the file system cache. Most UNIX file systems set aside an area of memory (the cache) to hold recently accessed files, which can subsequently allow physical I/O requests to be satisfied from memory instead of from disk. If DB2 requests data that is not already in the cache, the operating system will read the data from disk into the cache, then copy the data to the DB2 buffer pool so that it can be used. Therefore, each read request translates into a disk read, followed by a copy of the data from the cache to the database buffer pool.
When the data is read from the cache, I/O requests can be satisfied in nanoseconds instead of the milliseconds that would be required to retrieve the data from disk. In addition, most UNIX file systems employ the use of a sequential read-ahead mechanism to prefetch data into the cache when it detects that a file is being accessed sequentially.
In non-database environments, the UNIX file system cache can significantly reduce I/O wait time for heavily accessed files. However, the performance benefits of file system caching in database environments are not so clear. This is due to the fact that most RDBMS systems, including DB2, also allocate a region of memory for caching frequently accessed data (i.e., the database buffer pools). This results in double buffering of the data in the file system cache and the DB2 buffer pool.
In 64-bit systems, the memory used by the file system cache could be better utilized by the database buffer pools. In 32-bit systems, with their associated shared memory limits, the file system cache can provide benefit for some workloads.
The primary benefit of raw logical volumes is that they bypass the file system cache by directly accessing the underlying logical device. The extra memory saved by eliminating the file system cache can then be allocated to the database buffer pools. In addition, overall CPU utilization is decreased, due to the fact that the system no longer has to copy the data from the file system cache to the database buffer pools.
Another benefit of raw logical volumes in AIX is that there is no inode management overhead, as opposed to file systems where the inode is locked when the file is accessed.
来自 “ ITPUB博客 ” ，链接：http://blog.itpub.net/4096/viewspace-52502/，如需转载，请注明出处，否则将追究法律责任。