/[scripts]/trunk/hdparm-readahead.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/hdparm-readahead.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 92 - (show annotations)
Tue Oct 21 22:58:45 2008 UTC (14 years, 3 months ago) by dpavlin
File MIME type: text/plain
File size: 514 byte(s)
test range of hdparm setting on drive

1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 my $drive = shift @ARGV || '/dev/sdb';
7
8 my $mult = 0;
9
10 my $size = -1;
11 my $new_size = 0;
12
13 while ( $new_size > $size ) {
14 $size = $new_size;
15
16 print "# $drive $mult ", $size ? "last: $size Mb" : "", "\n";
17 system "hdparm -a $mult $drive";
18 my $hdparm = `hdparm -tT $drive`;
19 print $hdparm;
20 if ( $hdparm =~ m/buffered disk reads:\s+(\d+)\s+MB in\s+(\d+\.\d+)\s+seconds/s ) {
21 $new_size = $1 / $2;
22 } else {
23 warn "can't find buffered disk reads:";
24 }
25
26 $mult += 16;
27 }
28
29

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26