Gather disk usage statistics with iostat
Takeaway: The iostat tool monitors I/O (Input/Output) performance related to disk drives. Find out how you can use iostat to better manage your network.
System monitoring is an important part of network administration. Fortunately, there are numerous tools on the market that monitor performance, network activity, and SMART status of hard drives. One tool that isn't very well known is called iostat, and it monitors I/O (Input/Output) performance related to disk drives.
Some Linux distributions ship with iostat. If your distribution doesn’t include it, simply download the iostat source code and build it as follows:
$ tar xvzf iostat-2.2.tar.gzcd iostat-2.2makeWhen the build is complete, you'll have the tool iostat and the manpage iostat.8 in the current directory. To install iostat and its manpage in the /usr/local directory tree, simply perform a "make install":
$ tar xvzf iostat-2.2.tar.gzcd iostat-2.2make installYou can run iostat with a number of options and two optional arguments: "interval" and "count." To view disk activity over time, provide it with an interval of 15 (seconds) and a count of 10 (samples). Here’s how:
$ ./iostat 15 10However, this will give you only basic information on the installed physical disk drives. To obtain more information, pass iostat a few more options, such as printing statistics per disk (-d), printing CPU activity stats (-c), including per-partition stats (-p), and including extended statistics (-x). For a good sampling of data, enter this code snippet:
$ ./iostat -DpxcSince iostat prints out a lot of information, you'll want to keep the manpage handy so that you can identify what each column means. Some of the information includes total transfer rate per second, total number of requests per second, number of reads (and writes) per second, percentage of CPU time spent in user, system, and idle modes, and much more.
If your system is slowing down and you're having a hard time finding the bottleneck, iostat may clue you in on some problem areas. Even before that slowdown, iostat can tell you what disks are over- and under-utilized, which allows you to plan ahead and balance the I/O load.
Delivered each Tuesday, TechRepublic's free Linux NetNote provides tips, articles, and other resources to help you hone your Linux skills. Automatically sign up today!
Print/View all Posts Comments on this article
SponsoredWhite Papers, Webcasts, and Downloads
- Using the Six Laws of Persuasion in Negotiations Global Knowledge
- TCP/IP Troubleshooting Global Knowledge
- Vista SP1: What You Need To Know Before You Deploy Global Knowledge
- Number Systems Decoded - Binary, Decimal, and Hexadecimal Global Knowledge
- What Is Micromanagement? And What You Can Do To Avoid It. Global Knowledge
Article Categories
- Security
- Security Solutions, IT Locksmith
- Networking and Communications
- E-mail Administration NetNote, Cisco Routers and Switches
- CIO and IT Management
- Project Management, CIO Issues, Strategies that Scale
- Desktops, Laptops & OS
- Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
- Data Management
- Oracle, SQL Server
- Servers
- Windows NT, Linux NetNote, Windows Server 2003
- Career Development
- Geek Trivia
- Software/Web Development
- Web Development Zone, Visual Basic, .NET
