|
Raw Disk I/ORaw disk I/O is a process that interacts with a disk directly. File I/O, on the other hand, is where a process interacts with a physical device through an intermediary kernel cache. The read() and write() file I/O require the data to be copied to and from user space through kernel buffered regions. Data might exist in two memory locations simultaneously. Some applications, such as databases, implement their own journaling. Applications that implement their own journaling can avoid duplicate logging (of their own database logs and the journaling file system logs) by performing I/O directly to the raw logical volume and bypassing the file system. Raw disk I/O is unbuffered, and the data is not cached in a kernel buffer. One area where raw I/O is used to increase performance is in a relational database, such as IBM DB2 and Oracle. The performance can be increased in unbuffered raw I/O because these relational databases have their own I/O buffer for caching. Setting up Raw I/O on LinuxBefore setting up raw I/O on Linux, you need the following:
# ln s /dev/your_raw_dev_ctrl/.dev/rawctl Linux has a pool of raw device nodes that must be bound to a block device before raw I/O can be performed on it. There is raw device controller that acts as the central repository of raw I/O to block device binding information. Binding is performed with a utility named raw. ExampleThe following example configures raw I/O on Linux. The example uses raw partition /dev/sda5, which contains no valuable data:
|
|