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.
NOTE
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.
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.
NOTE
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.
本文探讨了数据库环境中使用裸设备与文件系统的性能差异。通过对比两种方式的数据读取过程,揭示了裸设备如何通过绕过文件系统缓存来减少CPU使用率并提高内存利用率,尤其是在64位系统中更为显著。

被折叠的 条评论
为什么被折叠?



