Share via


diskidlehistogram

Applies To: Windows 8, Windows 8.1

This action produces a histogram that displays all disk activity and idle time.

-a diskidlehistogram [-disknum <n>] [-buckets B1 B2 ... Bn] [-idletimeout T1 T2 ... Tn] [-idletheshold <t>] [-spindownOverhead [t]] [-spinupOverhead [t]] [-exc_file File1 File2 ... FileN] [-exc_filestr String1 String2 ... StringN] [-exc_filere <regex>]

Options

  • -disknum<n>**
    n indicates the disk number (0-based disk index). The default value is to output histograms for all disks.
  • -bucketsB1 B2 … Bn**
    Arguments indicate different ranges of idle length, in seconds. Default buckets are as follows:

    • [0 s, 1 s]

    • [1 s, 5 s]

    • [5 s, 60 s]

    • [60 s, 180 s]

    • [180 s, 600 s]

    • [600 s, 900 s]

    • [900 s, 1200 s]

    • [1200 s, 1800 s]

    • [1800 s, +inf]

    A disk idle histogram displays the distribution of disk idle time and the number of idle periods over different ranges of idle period length, as illustrated by the example values in the following table.

  Less than 1 second 1-600 seconds More than 600 seconds

Idle time

1000

1000

2000

Percent of total idle time

25

25

50

Idle count

90

5

5

Percent of total idle count

90

5

5

The first row shows the histogram’s buckets: different ranges of idle length. The second row shows the accumulated idle time for each bucket. For example, the accumulated idle time for all idle periods shorter than 1 second is 1000 seconds. The third row calculates the percentage of idle time for each bucket by dividing the idle time for a bucket by the total idle time. The fourth row is the count of idle periods captured for each bucket. In this example, there are 90 idle periods lasting less than one second. The last row calculates the percentage of idle periods for each bucket by dividing the number of idle periods for a bucket by the total number of idle periods. The follow command would produce the buckets in the following list: **-buckets 1s 5s 60s 180s**: - \[0, 1 s\] - \[1 s, 5 s\] - \[5 s, 60 s\] - \[60 s, 180 s\] - \[180 s, +inf\]
  • -idletimeoutT1 T2 … Tn**
    Arguments indicate the idle timeout, in seconds. The default values are 5, 60, 180, 600, and 1800.
  • -idletheshold<t>**
    Arguments indicate the idle threshold, in seconds. Idle periods shorter than this threshold are ignored.
  • -spindownOverhead[t]**
    If you do not specify an argument, the default value is 0.

    Using a sequence of disk I/O timestamps and a specified idle timeout, you can compute when the disk would be spun down and how much time it can stay in spun-down state, as illustrated in the following table.

Timeout, in seconds 5 60 180 600

Estimated spindown opportunity time, in seconds

3800

2000

1000

500

Estimated spindown opportunity count

500

100

50

10

The first row shows the idle timeout values of interest for estimating spun-down time. The second row shows the estimated total spun-down time corresponding to each timeout. In this example, a timeout of 5 seconds yielded the total spun-down time of 3800 seconds. The third row shows the estimated number of times the disk is spun down for each timeout value.
  • -spinupOverheadT**
    If you do not specify an argument, the default value is 0 seconds.
  • -exc_fileFile1 File1 … FileN**
    Files matching the provided full file paths are excluded. You must specify the full file path for each file you want to exclude.
  • -exc_filestrString1 String2 … StringN**
    Files containing one or more of the provided strings are excluded.
  • -exc_filere<regx>**
    Files matching the provided ATL regular expression are excluded. For example, you can ignore all files ending with .dll by specifying the expression ".*\.dll".

Remarks

There are a few system files whose disk I/Os are in response to disk I/Os to other files. These system files include the following:

  • $LogFiles

  • $Mft

  • $Bitmap

  • lastalive0.dat

  • lastalive1.dat

  • $UsnJrnl:$J

It can be difficult to differentiate which disk I/Os to other files cause a particular disk I/O to the above system files. Consequently, if you want to see the impact of the files that you have excluded, you must also exclude these system files. Because these system files’ disk I/Os are in response to or "piggyback" on other disk I/Os, ignoring only these system files themselves is not expected to change the disk idle histogram significantly.

Output from this action can be imported into a spreadsheet for sorting and analysis. Two additional metrics are provided for the output:

  • AvgIOInterval
    For a particular file, this is the average interval between two subsequent I/Os to this file. This metric can be misleading if a file has tiny I/O intervals, such as intervals of less than 1 second. Even if this file also has large I/O intervals, such as 30 minutes, the average IO interval may look much worse than another file with medium short I/O intervals, such as 10 minutes. In this case, you could use -idlethreshold T to remove idle periods of less than 1 second from the analysis.
  • MaxIOInterval
    For each file, this is the maximum interval between two subsequent I/Os to this file. The output is sorted based on this metric by default. A file with one large I/O interval can still have frequent I/Os on average.

Note

Use both of these metrics and per-file histograms for a comprehensive picture of disk activity.

Avoid perturbing the disk(s) under study by using a different physical disk (or device such as a USB flash drive) to collect the trace.

Example

The following example shows a typical use of this action with default parameters

Xperf -i Trace.etl -a diskidlehistogram > output.csv

Collect information on disk I/Os as well as related information, such as registry/cswitch/stacks, in case deeper analysis is needed. Compact_cswitch can be used to reduce trace file size. The following example shows a set of recommended Xperf flags.

xperf -on dispatcher+PROC_THREAD+LOADER+CSWITCH+COMPACT_CSWITCH +registry+DISK_IO+DISK_IO_INIT+FILEIO -stackwalk cswitch+readythread+DiskReadInit+DiskWriteInit+DiskFlushInit -buffersize 1024
sleep <desired trace time in seconds> or run scenario
xperf -d trace.etl

See Also

Other Resources

Xperf Actions