1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Windowsで負荷テスト(ストレージ負荷)

Last updated at Posted at 2022-06-20

microsoft / diskspd
https://github.com/microsoft/diskspd

DISKSPD はストレージ負荷ジェネレーターです。
Windows / Windows Server および Cloud Server インフラストラクチャエンジニアリングチームのパフォーマンステストツール

コマンドラインツールですね。
C:\Users\hoge\Downloads\DiskSpd\amd64>diskspd

Usage
Usage: diskspd [options] target1 [ target2 [ target3 ...] ]
version 2.1.0-dev (2021/7/1)

Valid targets:
       file_path
       #<physical drive number>
       <drive_letter>:

Available options:
  -?                    display usage information
  -ag                   group affinity - affinitize threads round-robin to cores in Processor Groups 0 - n.
                          Group 0 is filled before Group 1, and so forth.
                          [default; use -n to disable default affinity]
  -ag#,#[,#,...]>       advanced CPU affinity - affinitize threads round-robin to the CPUs provided. The g# notation
                          specifies Processor Groups for the following CPU core #s. Multiple Processor Groups
                          may be specified, and groups/cores may be repeated. If no group is specified, 0 is assumed.
                          Additional groups/processors may be added, comma separated, or on separate parameters.
                          Examples: -a0,1,2 and -ag0,0,1,2 are equivalent.
                                    -ag0,0,1,2,g1,0,1,2 specifies the first three cores in groups 0 and 1.
                                    -ag0,0,1,2 -ag1,0,1,2 is equivalent.
  -b<size>[KMGT]        block size in bytes or KiB/MiB/GiB/TiB [default=64K]
  -B<offs>[KMGTb]       base target offset in bytes or KiB/MiB/GiB/TiB/blocks [default=0]
                          (offset from the beginning of the file)
  -c<size>[KMGTb]       create files of the given size.
                          Size can be stated in bytes or KiB/MiB/GiB/TiB/blocks
  -C<seconds>           cool down time - duration of the test after measurements finished [default=0s].
  -D<milliseconds>      Capture IOPs statistics in intervals of <milliseconds>; these are per-thread
                          per-target: text output provides IOPs standard deviation, XML provides the full
                          IOPs time series in addition. [default=1000, 1 second].
  -d<seconds>           duration (in seconds) to run test [default=10s]
  -f<size>[KMGTb]       target size - use only the first <size> bytes or KiB/MiB/GiB/TiB/blocks of the file/disk/partition,
                          for example to test only the first sectors of a disk
  -f<rst>               open file with one or more additional access hints
                          r : the FILE_FLAG_RANDOM_ACCESS hint
                          s : the FILE_FLAG_SEQUENTIAL_SCAN hint
                          t : the FILE_ATTRIBUTE_TEMPORARY hint
                          [default: none]
  -F<count>             total number of threads (conflicts with -t)
  -g<value>[i]          throughput per-thread per-target throttled to given value; defaults to bytes per millisecond
                          With the optional i qualifier the value is IOPS of the specified block size (-b).
                          Throughput limits cannot be specified when using completion routines (-x)
                          [default: no limit]
  -h                    deprecated, see -Sh
  -i<count>             number of IOs per burst; see -j [default: inactive]
  -j<milliseconds>      interval in <milliseconds> between issuing IO bursts; see -i [default: inactive]
  -I<priority>          Set IO priority to <priority>. Available values are: 1-very low, 2-low, 3-normal (default)
  -l                    Use large pages for IO buffers
  -L                    measure latency statistics
  -n                    disable default affinity (-a)
  -N<vni>               specify the flush mode for memory mapped I/O
                          v : uses the FlushViewOfFile API
                          n : uses the RtlFlushNonVolatileMemory API
                          i : uses RtlFlushNonVolatileMemory without waiting for the flush to drain
                          [default: none]
  -o<count>             number of outstanding I/O requests per target per thread
                          (1=synchronous I/O, unless more than 1 thread is specified with -F)
                          [default=2]
  -O<count>             number of outstanding I/O requests per thread - for use with -F
                          (1=synchronous I/O)
  -p                    start parallel sequential I/O operations with the same offset
                          (ignored if -r is specified, makes sense only with -o2 or greater)
  -P<count>             enable printing a progress dot after each <count> [default=65536]
                          completed I/O operations, counted separately by each thread
  -r[align[KMGTb]]      random I/O aligned to <align> in bytes/KiB/MiB/GiB/TiB/blocks (overrides -s)
                          [default alignment=block size (-b)]
  -rd<dist>[params]     specify an non-uniform distribution for random IO in the target
                          [default uniformly random]
                           distributions: pct, abs
                           all:  IO% and %Target/Size are cumulative. If the sum of IO% is less than 100% the
                                 remainder is applied to the remainder of the target. An IO% of 0 indicates a gap -
                                 no IO will be issued to that range of the target.
                           pct : parameter is a combination of IO%/%Target separated by : (colon)
                                 Example: -rdpct90/10:0/10:5/20 specifies 90% of IO in 10% of the target, no IO
                                   next 10%, 5% IO in the next 20% and the remaining 5% of IO in the last 60%
                           abs : parameter is a combination of IO/Target Size separated by : (colon)
                                 If the actual target size is smaller than the distribution, the relative values of IO%
                                 for the valid elements define the effective distribution.
                                 Example: -rdabs90/10G:0/10G:5/20G specifies 90% of IO in 10GiB of the target, no IO
                                   next 10GiB, 5% IO in the next 20GiB and the remaining 5% of IO in the remaining
                                   capacity of the target. If the target is only 20G, the distribution truncates at
                                   90/10G:0:10G and all IO is directed to the first 10G (equivalent to -f10G).
  -rs<percentage>       percentage of requests which should be issued randomly. When used, -r may be used to
                          specify IO alignment (applies to both the random and sequential portions of the load).
                          Sequential IO runs will be homogeneous if a mixed ratio is specified (-w), and run
                          lengths will follow a geometric distribution based on the percentage split.
  -R[p]<text|xml>       output format. With the p prefix, the input profile (command line or XML) is validated and
                          re-output in the specified format without running load, useful for checking or building
                          complex profiles.
                          [default: text]
  -s[i][align[KMGTb]]   stride size of <align> in bytes/KiB/MiB/GiB/TiB/blocks, alignment/offset between operations
                          [default=non-interlocked, default alignment=block size (-b)]
                          By default threads track independent sequential IO offsets starting at offset 0 of the target.
                          With multiple threads this results in threads overlapping their IOs - see -T to divide
                          them into multiple separate sequential streams on the target.
                          With the optional i qualifier (-si) threads interlock on a shared sequential offset.
                          Interlocked operations may introduce overhead but make it possible to issue a single
                          sequential stream to a target which responds faster than a one thread can drive.
                          (ignored if -r specified, -si conflicts with -p, -rs and -T)
  -S[bhmruw]            control caching behavior [default: caching is enabled, no writethrough]
                          non-conflicting flags may be combined in any order; ex: -Sbw, -Suw, -Swu
  -S                    equivalent to -Su
  -Sb                   enable caching (default, explicitly stated)
  -Sh                   equivalent -Suw
  -Sm                   enable memory mapped I/O
  -Su                   disable software caching, equivalent to FILE_FLAG_NO_BUFFERING
  -Sr                   disable local caching, with remote sw caching enabled; only valid for remote filesystems
  -Sw                   enable writethrough (no hardware write caching), equivalent to FILE_FLAG_WRITE_THROUGH or
                          non-temporal writes for memory mapped I/O (-Sm)
  -t<count>             number of threads per target (conflicts with -F)
  -T<offs>[KMGTb]       starting stride between I/O operations performed on the same target by different threads
                          [default=0] (starting offset = base file offset + (thread number * <offs>)
                          only applies with #threads > 1
  -v                    verbose mode
  -w<percentage>        percentage of write requests (-w and -w0 are equivalent and result in a read-only workload).
                        absence of this switch indicates 100% reads
                          IMPORTANT: a write test will destroy existing data without a warning
  -W<seconds>           warm up time - duration of the test before measurements start [default=5s]
  -x                    use completion routines instead of I/O Completion Ports
  -X<filepath>          use an XML file to configure the workload. Combine with -R, -v and -z to override profile defaults.
                          Targets can be defined in XML profiles as template paths of the form *<integer> (*1, *2, ...).
                          When run, specify the paths to substitute for the template paths in order on the command line.
                          The first specified target is *1, second is *2, and so on.
                          Example: diskspd -Xprof.xml first.bin second.bin (prof.xml using *1 and *2)
  -z[seed]              set random seed [with no -z, seed=0; with plain -z, seed is based on system run time]

Write buffers:
  -Z                    zero buffers used for write tests
  -Zr                   per IO random buffers used for write tests - this incurrs additional run-time
                         overhead to create random content and shouln't be compared to results run
                         without -Zr
  -Z<size>[KMGb]        use a <size> buffer filled with random data as a source for write operations.
  -Z<size>[KMGb],<file> use a <size> buffer filled with data from <file> as a source for write operations.

  By default, the write buffers are filled with a repeating pattern (0, 1, 2, ..., 255, 0, 1, ...)

Synchronization:
  -ys<eventname>     signals event <eventname> before starting the actual run (no warmup)
                       (creates a notification event if <eventname> does not exist)
  -yf<eventname>     signals event <eventname> after the actual run finishes (no cooldown)
                       (creates a notification event if <eventname> does not exist)
  -yr<eventname>     waits on event <eventname> before starting the run (including warmup)
                       (creates a notification event if <eventname> does not exist)
  -yp<eventname>     stops the run when event <eventname> is set; CTRL+C is bound to this event
                       (creates a notification event if <eventname> does not exist)
  -ye<eventname>     sets event <eventname> and quits

Event Tracing:
  -e<q|c|s>             Use query perf timer (qpc), cycle count, or system timer respectively.
                          [default = q, query perf timer (qpc)]
  -ep                   use paged memory for the NT Kernel Logger [default=non-paged memory]
  -ePROCESS             process start & end
  -eTHREAD              thread start & end
  -eIMAGE_LOAD          image load
  -eDISK_IO             physical disk IO
  -eMEMORY_PAGE_FAULTS  all page faults
  -eMEMORY_HARD_FAULTS  hard faults only
  -eNETWORK             TCP/IP, UDP/IP send & receive
  -eREGISTRY            registry calls


Examples:

Create 8192KB file and run read test on it for 1 second:

  diskspd -c8192K -d1 testfile.dat

Set block size to 4KB, create 2 threads per file, 32 overlapped (outstanding)
I/O operations per thread, disable all caching mechanisms and run block-aligned random
access read test lasting 10 seconds:

  diskspd -b4K -t2 -r -o32 -d10 -Sh testfile.dat

Create two 1GB files, set block size to 4KB, create 2 threads per file, affinitize threads
to CPUs 0 and 1 (each file will have threads affinitized to both CPUs) and run read test
lasting 10 seconds:

  diskspd -c1G -b4K -t2 -d10 -a0,1 testfile1.dat testfile2.dat

パラメータが多いですね。
こんなときは、Examples で試してみましょう。

コマンド プロンプト
C:\Users\Hoge\Downloads\DiskSpd\amd64>diskspd -c10g -d20 hogehoge.dat

Command Line: diskspd -c10g -d20 hogehoge.dat

Input parameters:

        timespan:   1
        -------------
        duration: 20s
        warm up time: 5s
        cool down time: 0s
        random seed: 0
        path: 'hogehoge.dat'
                think time: 0ms
                burst size: 0
                using software cache
                using hardware write cache, writethrough off
                performing read test
                block size: 64KiB
                using sequential I/O (stride: 64KiB)
                number of outstanding I/O operations per thread: 2
                threads per file: 1
                using I/O Completion Ports
                IO priority: normal

System information:

        computer name: HOGE-PC
        start time: 2022/06/20 00:29:58 UTC

Results for timespan 1:
*******************************************************************************

actual test time:       20.00s
thread count:           1
proc count:             8

CPU |  Usage |  User  |  Kernel |  Idle
-------------------------------------------
   0|  71.48%|  10.63%|   60.86%|  28.52%
   1|  54.45%|  14.61%|   39.84%|  45.55%
   2|  72.89%|  19.69%|   53.20%|  27.11%
   3|  66.17%|  18.75%|   47.42%|  33.83%
   4|  71.48%|  16.17%|   55.31%|  28.52%
   5|  67.66%|  18.52%|   49.14%|  32.34%
   6|  83.05%|  18.36%|   64.69%|  16.95%
   7|  83.59%|  20.63%|   62.97%|  16.41%
-------------------------------------------
avg.|  71.35%|  17.17%|   54.18%|  28.65%

Total IO
thread |       bytes     |     I/Os     |    MiB/s   |  I/O per s |  file
------------------------------------------------------------------------------
     0 |      9749725184 |       148769 |     464.87 |    7437.86 | hogehoge.dat (10GiB)
------------------------------------------------------------------------------
total:        9749725184 |       148769 |     464.87 |    7437.86

Read IO
thread |       bytes     |     I/Os     |    MiB/s   |  I/O per s |  file
------------------------------------------------------------------------------
     0 |      9749725184 |       148769 |     464.87 |    7437.86 | hogehoge.dat (10GiB)
------------------------------------------------------------------------------
total:        9749725184 |       148769 |     464.87 |    7437.86

Write IO
thread |       bytes     |     I/Os     |    MiB/s   |  I/O per s |  file
------------------------------------------------------------------------------
     0 |               0 |            0 |       0.00 |       0.00 | hogehoge.dat (10GiB)
------------------------------------------------------------------------------
total:                 0 |            0 |       0.00 |       0.00

10GB の hogehoge.dat を作成して、20秒間読み込むコマンドです。
C:\Users\Hoge\Downloads\DiskSpd\amd64>diskspd -c10g -d20 hogehoge.dat

タスクマネージャーで見ると負荷は上がっていますね。

C:\Users\Hoge\Downloads\DiskSpd\amd64>dir
 ドライブ C のボリューム ラベルは Windows です
 ボリューム シリアル番号は E4FE-1FBF です

 C:\Users\Hoge\Downloads\DiskSpd\amd64 のディレクトリ

2022/06/20  09:29    <DIR>          .
2022/06/20  09:29    <DIR>          ..
2021/09/17  13:44           282,872 diskspd.exe
2021/09/16  06:24         3,960,832 diskspd.pdb
2022/06/20  09:33    10,737,418,240 hogehoge.dat
               3 個のファイル      10,741,661,944 バイト
               2 個のディレクトリ  64,278,204,416 バイトの空き領域

作成したファイル(ここでは、hogehoge.dat)は、残っていますので削除してください。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?