Mercurial > hg > Papers > 2021 > mk-thesis
comparison paper/file/benchmark/README.md @ 34:bcf20ce5201e
add benchmarks
author | Ken Miyahira <e175733@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 07 Feb 2021 19:49:56 +0900 |
parents | |
children | d8f79c7bf155 |
comparison
equal
deleted
inserted
replaced
33:44a8408a59a6 | 34:bcf20ce5201e |
---|---|
1 # Benchmark | |
2 | |
3 ## dd-benchmark | |
4 | |
5 書き込み, 読み込みの測定には[dd-benchmark](https://romanrm.net/dd-benchmark)を使用する。最近では[fio](https://github.com/axboe/fio)がお勧め。 | |
6 | |
7 * 下記のコマンドで測定を行う。 | |
8 ```sh | |
9 # 書き込み | |
10 dd if=/dev/zero of=benchmark bs=64K count=64K conv=fdatasync | |
11 | |
12 # 読み込み | |
13 dd if=benchmark of=/dev/null | |
14 ``` | |
15 | |
16 * `conv=fdatasync`が最も普段の動作に近いらしい。 | |
17 >This tells dd to require a complete “sync” once, right before it exits. So it commits the whole 256 MB of data, then tells the operating system: “OK, now ensure this is completely on disk”, only then measures the total time it took to do all that and calculates the benchmark result. | |
18 | |
19 ### 測定用のshell | |
20 | |
21 ベンチでは, 128MB, 256MB, 512MB, 1GB, 2GB, 4GBの書き込み, 読み込み速度を測定する。測定用のshellは下のやつを利用する。 | |
22 | |
23 ```sh | |
24 #!/bin/sh | |
25 | |
26 for c in 2 4 8 16 32 64 | |
27 do | |
28 echo "Write" | |
29 dd if=/dev/zero of=benchmark bs=64K count=$c"K" conv=fdatasync | |
30 | |
31 echo "Read" | |
32 dd if=benchmark of=/dev/null | |
33 | |
34 rm benchmark | |
35 done | |
36 ``` |