How To: Double Linux disk read performance with readahead parameter

by Vivek Gite on November 22, 2007 · 4 comments

The open source journal has published an interesting hack. It mostly applies to high-end, multiple-disk storage:

Under the right conditions (that is, with certain hardware configurations which I'll identify later) it is possible to literally double your sequential read performance from disk. If you noticed the terrible performance of the 3Ware 9500S RAID controller and cared enough to investigate. It all has to do with a sneaky little block device parameter known as readahead. Without going into too much gory detail, readahead controls how much in advance the operating system reads when, well, reading, as its name implies. By default, some operating systems (in particular, RHEL5 Server) sets this to 256 (512-byte sectors), or about 128 KB. When dealing with large filesystems spanning many disks, this paltry figure can actually nuke your performance.

=> HowTo: Linux: Double your disk read performance in a single command

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

We're here to help you make the most of sysadmin work. So, subscribe!

{ 4 comments… read them below or add one }

1 Seb December 18, 2007

Very interesting

Reply

2 Joe Roadkill May 10, 2010

Hey, this blog entry is USELESS because the link is now roadkill on the information super highway. If you had at least included the exact name of the readahead parameter then this page – which comes up right at the top of a google search for “linux readahead” would actually be useful.

Reply

3 robert beck August 20, 2010

blockdev -setra xxx
e.g. blockdev -setra 1024 /dev/sda

Also try /etc/sysctl.conf:
/sys/bus/scsi/drivers/sd/[DEVICEID]/block/queue/read_ahead_kb

Reply

4 Gabriel Ramuglia January 18, 2011

What’s reported in robert’s post is useful, but not syntactically accurate, as it’s missing a -

The command I use is typically:

blockdev –setra 1024 /dev/sda

for a 512kb readahead

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 6 + 5 ?
Please leave these two fields as-is:
Are you a human being? Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: