Current Issue


Table of contents

CD-ROM

Sys Admin and The Perl Journal CD-ROM version 12.0

Version 12.0 delivers every issue of Sys Admin from 1992 through 2006 and every
issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!

Sys Admin Magazine > Archives > 2006 > November Linux Supplement
SysAdminMag.com

Using Adaptive Read-Ahead to Improve I/O Throughput on Linux

Mulyadi Santosa and Fengguang Wu

For years, I/O has been a major problem when dealing with latency. CPU, memory, network connection, and bus are getting faster in significant way. But what about disk? With the birth of SATA, disk is getting some acceleration, but the problem with disk access is that it is so slow compared to memory access.

Disk cache was invented to overcome this. When a read operation is issued, data is brought to RAM. From there, the CPU can access it. Furthermore, when data is written to the disk, it is put to buffer and later pushed to the disk. This is done for two reasons. The first reason is for reading operations. Here we are caching the data to anticipate further read requests on the same blocks. As stated in the temporal locality principle, a program tends to read same data over and over again during a certain interval. If we apply that to disk access, on the second access, there is no need to read from the disk, the CPU can just access it through disk cache.

The second reason is for writing operations. If the CPU must wait until the data is actually written to the disk, the CPU will be completely blocked. A solution for this is using buffer as temporary storage. The CPU just puts the data on buffer and continues to work. There's no need to wait for lengthy disk access.

Another feature can help you overcome disk latency: read-ahead. The basic idea is that if you read a block from a file, there is a chance that you will read the next block of the same file. Thus, if somehow the kernel can predict it, it can "read-ahead" to the next block(s). So, when the data is needed, it is already on the disk cache.




MarketPlace

�Six Sigma� Certified?
100% Online-Six Sigma Certificate From Villanova -Find Out More Now.

Project Management-Online
Nation's Leading Online PMP Course From Villanova-Find Out More Now.

Flowcharts from C/C++ code -- Free trial download
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.

Automate Software Builds with Visual Build Pro
Easily create an automated, repeatable process for building and deploying software.

Wanna see your ad here?