14

I want to see something for Linux similar to the Perfmon program under Windows. Does such a thing exist that is terminal friendly and not a gui program? Thanks.

eee
  • 143
  • 1
  • 4

5 Answers5

21

iostat is what you're looking for:

   iostat - Report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions.

Calling it like such will get you KB/s every 2 seconds:

$ iostat -k 2

Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
sdb               0.89         2.39         1.72     189644     136436
sda               5.42        31.79        40.89    2519836    3240543
Bob
  • 726
  • 4
  • 4
7

Use iostat. E.g. iostat 2 Will output the io statistics every 2 seconds. Note however that it outputs blocks per second. Typically, a block is 4 KB but might be different depending on the actual block device used.

Holger Just
  • 3,325
  • 1
  • 17
  • 23
5

You might need per-process statistics : iostat (though otherwise really good) doesn't know how to do that, but iotop can.

Francois G
  • 406
  • 2
  • 7
2

Also look at nmon from IBM. http://en.wikipedia.org/wiki/Nmon

ewwhite
  • 197,159
  • 92
  • 443
  • 809
2

If you want more than just I/O can also use SAR:

The sar command writes to standard output the contents of selected cumulative activity counters in the operating system.

sar files contains information on processor, memory, disk, network. These files are generated daily based on system and retained for some number of days based on system configuration.

If you run sar -A you will get all the counters, and there are lots, for the current day. You can also run sar -A -f /var/log/sa[DD] where DD is the day of the month such as sa01 or sa14.

If you want information specific to I/O I suggest trying the following switches and looking at the man pages for further detail:

-b Report I/O and transfer rate statistics.

-d Report activity for each block device (kernels 2.4 and newer only).

This is a very useful tool for diagnosing historical issues and performance concerns.

Gray Race
  • 853
  • 3
  • 11
  • 22