If you use
MRTG, you can make a graph of I/O token usage, or anything else graphable.
Here's a Perl script for collecting the token count:
Code:
#!/usr/bin/perl
$line = `/usr/bin/uptime`;
($uptime) = ($line =~ m/^.*up (.*),\s+\d+\s+users*,\s+load average:.*$/o);
$host = `/bin/hostname`;
open IOSTATUS, "/proc/io_status";
$line = <IOSTATUS>;
close IOSTATUS;
($count) = ($line =~ m/^io_count=(\d+) .*$/o);
print "$count\n0\n$uptime\n$host\n";
And here is the stanza for mrtg.cfg:
Code:
Title[io_rate]: I/O Rate for Linode VPS
Target[io_rate]: `/usr/local/bin/tokenrate.pl`
PageTop[io_rate]: <H1>I/O Token Usage Rate</H1>
Options[io_rate]: logscale
MaxBytes[io_rate]: 400000
YLegend[io_rate]: Tokens/sec
ShortLegend[io_rate]: Tokens/sec
LegendI[io_rate]: Tokens/sec:
LegendO[io_rate]:
Legend1[io_rate]: I/O Token Usage Rate
Legend2[io_rate]:
I use the
logscale option to plot the graphs with a logarithmic scale, so that low rates don't get lost among large peaks.