0

Consider understanding the performance of a C program which writes blocks between 12 and 16 KiB to a few files sequentially within each file.

It produces the following iostat -x line1 from a one second interval for a disk under a fairly heavy load of ~16 KiB writes:

Device               w/s     wkB/s   wrqm/s  %wrqm w_await wareq-sz  aqu-sz  %util
nvme1n1          7497.00 105250.50     0.00   0.00    0.03    14.04    0.23 100.00

It shows 100% utilization and aqu-sz of 0.23. This is typical reading for this workload: the queue size generally hovers around 0.20 to 0.25 and the utilizatio is usually 100%, but for an occasional measurement interval somewhat less like 90% or 95%.

As I understand it, utilization is "the fraction of time at least 1 request was outstanding to the disk"2. So 100% means that at least 1 request was outstanding at all times. The aqu-sz or average queue size, as I understand it, is the time-averaged size of the requests outstanding queue, i.e., the average number of in-flight requests submitted to the block layer which haven't yet completed.

Something is wrong though: this reading is not consistent with these definitions. If there were at least 1 request outstanding at all times (implied by utilization 100%) then the average queue size must be at least 1.0, since it is never less than 1.0 at any moment.

So what's up with that?


1 I've cut out the read and discard stats since they are both ~0 for this run.

2 Unlike single-head disks, for HDDs with multiple independent heads and for modern SSDs which can both handle several outstanding requests, a utilization of 100% does not correspond to "saturated device".

BeeOnRope
  • 60,350
  • 16
  • 207
  • 386
  • 1
    How is this a programming question? Maybe check on proper site https://serverfault.com/q/1111657/115396 – stark Feb 06 '23 at 15:16
  • I'm programming a process and need to undestand its performance. This type of thing [has always been on-topic at SO](https://stackoverflow.com/help/on-topic), since it extends to tools used by programmers. This question might _also_ be appropriate on another stackexchange site: SO is not disjoint with e.g., serverfault and unix sites. – BeeOnRope Feb 06 '23 at 15:32
  • I suspect it is because NVMe bypasses scheduling. See https://stackoverflow.com/a/27664577/1216776 – stark Feb 06 '23 at 18:58
  • 1
    I believe that means programming tools ... even if a programmer uses word to write their documentation that doesn't make questions about using word on-topic. – tink Feb 06 '23 at 19:13
  • 1
    @tink: Actually it's any tool, if the entire condition is met. "software tools commonly used by programmers; **and is a practical, answerable problem that is UNIQUE to software development**" This question is not unique to software development; it would arise commonly in server management. – Ben Voigt Feb 06 '23 at 20:08
  • @BeeOnRope: The overlap between SO and SF allows asking programming questions on SF if they are about automating server management functions. A question about writing an `iostat` tool would be on-topic on both sites. Use of the existing `iostat` tool is on-topic on SF but off-topic here. – Ben Voigt Feb 06 '23 at 20:12
  • @tink Do you mean that `any` questions about the usage of word is off-topic here ? – Philippe Feb 06 '23 at 20:23
  • @Philippe -no, if you were using VBA or some such you'd be alright... – tink Feb 06 '23 at 20:43
  • @tink VBA is not in the category of `usage` of word, because it's a programming language. – Philippe Feb 06 '23 at 20:52
  • Nuh, for that I'd go to [su] ;) – tink Feb 06 '23 at 21:00
  • And which non-programming uses of word would see as fitting here? But that may be a better fit on meta, rather than in the comments to this rightfully closed thread ;) – tink Feb 06 '23 at 21:00
  • As you mention SU, I'll rephrase my last question : if you have a question on keyboard shortcuts in Word, and you estimate you have 90% of chance to get an anwser in SO, but 10% of chance to get an answer in SU, are you still going to SU ? – Philippe Feb 06 '23 at 21:02
  • Absolutely, as a keyboard shortcut in word has nothing to do w/ programming. Just like I wouldn't ask my physio about bikes, even though I know he is very knowledgeable. – tink Feb 06 '23 at 21:11

0 Answers0