2

I need to find out which process if likely responsible for damaging SD card on raspberri pi due to excessive io. So far sudo iotop -aoP almost cut it. Got it from the answer on How can I monitor disk io?

Total DISK READ :       0.00 B/s | Total DISK WRITE :       0.00 B/s
Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
  PID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND
 3200 be/4 pi            0.00 B      8.00 K  0.00 %  0.00 % apache2 -k start
 2001 be/4 pi            0.00 B      8.00 K  0.00 %  0.00 % apache2 -k start
  852 be/4 pi            0.00 B      8.00 K  0.00 %  0.00 % apache2 -k start
 3194 be/4 pi            0.00 B      8.00 K  0.00 %  0.00 % apache2 -k start
  856 be/4 pi            0.00 B      8.00 K  0.00 %  0.00 % apache2 -k start
  855 be/4 pi            0.00 B      8.00 K  0.00 %  0.00 % apache2 -k start
14757 be/4 root          0.00 B      4.00 K  0.00 %  0.00 % [kworker/u8:1]
  959 be/4 pi            0.00 B     16.00 K  0.00 %  0.00 % apache6.45 Ktart

apache6.45 Ktart looks like a terminal refresh bug. iotop data is not enough:

  1. iotop shows writers that were active in the last (few?) second and I need a list of top writer since the tool was started.

  2. It doesn't sort writers by most K written.

  3. I need an average write speed of each writer over the last minute. It shows only average speed for last (few?) second.

  4. There is no summary of avg/writing speed over last minute (or since program start).

So is there a way/tool to get such accumulated disk io stats per process?

  • sysstat provides sar command, which you can use for multiple things, including disk – ILMostro_7 May 12 '17 at 7:55
  • @ILMostro_7 can it do disk things that I needed? – anatoly techtonik May 13 '17 at 17:31
  • atop might be another tool to check out. It creates a snapshot view, based on the configured time intervals, of the processes and other useful info. You might find it more suitable for your specific needs. – ILMostro_7 May 13 '17 at 19:17
3

You should look at the man page of iotop, which has several options.

iotop shows writers that were active in the last (few?) second and
I need a list of top writer since the tool was started.

Use the -a option to ask iotop to accumulate the data.

It doesn't sort writers by most K written.

Use the arrow keys to change the column of sorting. By default the IO percentage column is sorted.

I need an average write speed of each writer over the last minute.
It shows only average speed for last (few?) second.

Use the -d option to specify the update interval.

  • 1
    You should point put the man pages too, man iotop – jas- Mar 20 '18 at 3:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.