[Solved] /proc/diskstats disk time spent writing more than 1000ms*CPU-core-count per second

z0lupka Asks: /proc/diskstats disk time spent writing more than 1000ms*CPU-core-count per second
I’m interested in how could one interpret the results of procfs-diskstats. It looks like an API, but I see no exhaustive explanation in Internet or man pages or Linux kernel Documentation.

There is a file with a very concise description:

Code:
The /proc/diskstats file displays the I/O statistics
of block devices. Each line contains the following 14
fields:

        ==  ===================================
         1  major number
         2  minor mumber
         3  device name
         4  reads completed successfully
         5  reads merged
         6  sectors read
         7  time spent reading (ms)
         8  writes completed
         9  writes merged
        10  sectors written
        11  time spent writing (ms)
        12  I/Os currently in progress
        13  time spent doing I/Os (ms)
        14  weighted time spent doing I/Os (ms)
        ==  ===================================
        ...

And also iostats.rst with a few words more. But it’s still hard to tell what exactly means f.e. this metric:

Code:
11  time spent writing (ms)

From iostats.rst:

Code:
Field 10 -- # of milliseconds spent doing I/Os (unsigned int)
    This field increases so long as field 9 is nonzero.

    Since 5.0 this field counts jiffies when at least one request was
    started or completed. If request runs more than 2 jiffies then some
    I/O time might be not accounted in case of concurrent requests.

But when I watch this value per second on my 4-core CPU VM, this value growing(increments) by more than 100000 ms while copying f.e 4Gb file.
I can assume that HDD/SSD(SATA? Depends on bus?) could serve multiple CPU cores requests in parallel.
On 4-core CPU that means that 100000 ms increment in this counter represents HDD/SDD serving [at least 25 seconds on every CPU core’s request] per second. Or 50 seconds on two cores (per second), or 100 second on 1 core (per second).

Common sense dictates that you cannot work more time per second than a second.

Related post: /proc/diskstats disk read time increasing more than second per second

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.