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?

1 Answers1

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.

HRJ
  • 121