Understanding iotop
Look at this question: https://unix.stackexchange.com/questions/282225/how-does-iotop-calculate-the-relative-i-o-activity.
The IO column shows the percentage of the process time that is spent waiting on IO operations. So it is not related to a global usage of the disk.
You pointed out in the comments that your disk is reading at ~130 MB/s. I have a 5400 RPM HD here and I benchmarked my system partition using gnome-disks and could not get more than 100 MB/s when reading. So maybe your disk is not being able to handle all that load and that is why the query is slow.
Related videos on Youtube
user35581
Updated on September 18, 2022Comments
-
user35581 almost 2 years
I have a postgresql select query that consumes only 12% CPU, and little to no memory, but it still takes about a minute to run.
I immediately tried to check the IO, using iotop. Sure enough, in iotop's "IO>" column my process was showing values in the 90-100 range.
A couple questions: Is this is a fractional percentage of all available IO? How is this calculated? My hard drive is a 7200RPM drive and the entire table is only 10 million rows. Is IO always limited by the read speed of the hard drive or can it be a different issue?
-
Ramhound about 10 yearsI would be shocked if most if not all of your database wasn't stored entirely in memory so a hdd bottlekneck has little to do with what you describe.
-
user35581 about 10 yearsFor some reason the "IO>" in iotop spikes when I run this query. The disk is only reading at ~130M/s and no writes are made. Also, there are only about 150 processes running, most of which are just background default linux processes.
-