2

I want to know which process writes/reads the most from disk over time, I mean that I will start the monitoring process than after X time I will be able to see what was the process that used the disk the most.

Is there anything like that?

I'm using Ubuntu 18.04.

peterh
  • 4,953
  • 13
  • 30
  • 44
XtoR
  • 21
  • 1
  • The answer clearly is "it depends". It will be different for every combination of installed software. – Gerald Schneider Jan 22 '19 at 09:37
  • If you are looking for a monitoring tool to do that, such questions are off topic here. There is a sister site called [softwarerecs.se] where you can ask the question. – Gerald Schneider Jan 22 '19 at 09:42
  • 1
    iotop command what you are looking for: https://linux.die.net/man/1/iotop – peterh Jan 22 '19 at 17:21
  • @GeraldSchneider I don't see how you consider this to be a software recommendation question. The question is asking how to do something with Ubuntu 18.04, so it's already specified which software to use. – kasperd Jan 22 '19 at 21:28

2 Answers2

1

You can use iotop for this. In batch mode, it can listen for a certain amount of time, printing the processes which used the disks in that time. Try this command:

 iotop -toqqqk -n 30|sort -n -r -k 7

This will wait for 30 secs, prints the processes doing I/O, and sorts the output so that the most disk-consuming process will be the first. The 7th column is "Disk write", if you want to see the ones doing the most read, sort on the 6th column.

Lacek
  • 7,233
  • 24
  • 28
0

Found out that there is a program called atop for further generations

XtoR
  • 1