0
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.

ESXiでダミーファイルを作るメモ

Posted at

ファイル転送の検証でダミーファイルの作成を行った時のメモ

for i in `seq 7`; do
  dd if=/dev/urandom of=/vmfs/volumes/datastore1/dummy/dummy_100gb_${i}.dat bs=100k count=1024000
done
  • 100GBのダミーファイルを7つ作成する
  • urandomからの疑似乱数を書き込む。/dev/randomはハードウェア等のノイズをシード値として真性乱数を生成する。シード値の供給速度には限界があるので、今回の用途ではシード値が枯渇してしまう。
  • BlockSizeの目安は100k-1M程度(後述)
  • ESXi shellはbashではなくshなので、ブレース展開等の表記法は使えない

(参考)ブロックサイズによるDD速度の違い

以下のように計測した結果、100k-1M程度が速かった。
キャッシュメモリ容量など、多分ハードウェアによっても変わる。(これはXeon Gold 5220R)

[root@verify-diskext:/vmfs/volumes/642fb369-751670ce-c3a8-98f2b326a07c] \
> time dd bs=1K count=1000000 if=/dev/urandom of=test ; echo ;\
> time dd bs=10K count=100000 if=/dev/urandom of=test ; echo ;\
> time dd bs=50K count=20000 if=/dev/urandom of=test ; echo ;\
> time dd bs=80K count=12500 if=/dev/urandom of=test ; echo ;\
> time dd bs=100K count=10000 if=/dev/urandom of=test ; echo ;\
> time dd bs=200K count=5000 if=/dev/urandom of=test ; echo ;\
> time dd bs=300K count=3333 if=/dev/urandom of=test ; echo ;\
> time dd bs=400K count=2500 if=/dev/urandom of=test ; echo ;\
> time dd bs=500K count=2000 if=/dev/urandom of=test ; echo ;\
> time dd bs=600K count=1667 if=/dev/urandom of=test ; echo ;\
> time dd bs=700K count=1429 if=/dev/urandom of=test ; echo ;\
> time dd bs=800K count=1250 if=/dev/urandom of=test ; echo ;\
> time dd bs=900K count=1111 if=/dev/urandom of=test ; echo ;\
> time dd bs=1M count=1000 if=/dev/urandom of=test ; echo ;\
> time dd bs=2M count=500 if=/dev/urandom of=test ; echo ;\time dd bs=4M count=250 if=/dev/urandom of=test ; echo ;\
> time dd bs=8M count=125 if=/dev/urandom of=test ; echo ;\
> time dd bs=10M count=100 if=/dev/urandom of=test ; echo ;\
> time dd bs=100M count=10 if=/dev/urandom of=test ; echo ;\
> time dd bs=1G count=1 if=/dev/urandom of=test ; echo
1000000+0 records in
1000000+0 records out
real    0m 13.40s
user    0m 12.64s
sys     0m 0.00s

100000+0 records in
100000+0 records out
real    0m 9.82s
user    0m 8.98s
sys     0m 0.00s

20000+0 records in
20000+0 records out
real    0m 9.44s
user    0m 8.65s
sys     0m 0.00s

12500+0 records in
12500+0 records out
real    0m 9.49s
user    0m 8.68s
sys     0m 0.00s

10000+0 records in
10000+0 records out
real    0m 9.39s
user    0m 8.81s
sys     0m 0.00s

5000+0 records in
5000+0 records out
real    0m 9.46s
user    0m 8.87s
sys     0m 0.00s

3333+0 records in
3333+0 records out
real    0m 9.51s
user    0m 8.86s
sys     0m 0.00s

2500+0 records in
2500+0 records out
real    0m 9.40s
user    0m 8.86s
sys     0m 0.00s

2000+0 records in
2000+0 records out
real    0m 9.46s
user    0m 8.87s
sys     0m 0.00s

1667+0 records in
1667+0 records out
real    0m 9.48s
user    0m 8.79s
sys     0m 0.00s

1429+0 records in
1429+0 records out
real    0m 9.40s
user    0m 8.68s
sys     0m 0.00s

1250+0 records in
1250+0 records out
real    0m 9.48s
user    0m 8.84s
sys     0m 0.00s

1111+0 records in
1111+0 records out
real    0m 9.52s
user    0m 8.86s
sys     0m 0.00s

1000+0 records in
1000+0 records out
real    0m 9.73s
user    0m 9.08s
sys     0m 0.00s

500+0 records in
500+0 records out
real    0m 9.76s
user    0m 9.19s
sys     0m 0.00s

250+0 records in
250+0 records out
real    0m 9.78s
user    0m 9.17s
sys     0m 0.00s

125+0 records in
125+0 records out
real    0m 9.74s
user    0m 9.20s
sys     0m 0.00s

100+0 records in
100+0 records out
real    0m 9.75s
user    0m 9.21s
sys     0m 0.00s

10+0 records in
10+0 records out
real    0m 9.94s
user    0m 9.37s
sys     0m 0.00s

dd: out of memory
Command exited with non-zero status 1
real    0m 0.00s
user    0m 0.00s
sys     0m 0.00s

============================================

[root@verify-diskext:/vmfs/volumes/642fb369-751670ce-c3a8-98f2b326a07c] \
> time dd bs=100K count=10000 if=/dev/urandom of=test ; echo ;\
> time dd bs=1M count=1000 if=/dev/urandom of=test ; echo ;\
> time dd bs=10M count=100 if=/dev/urandom of=test ; echo ;\
> time dd bs=100M count=10 if=/dev/urandom of=test ; echo ;\
> time dd bs=1G count=1 if=/dev/urandom of=test ; echo
10000+0 records in
10000+0 records out
real    0m 9.46s
user    0m 8.80s
sys     0m 0.00s

1000+0 records in
1000+0 records out
real    0m 9.74s
user    0m 9.10s
sys     0m 0.00s

100+0 records in
100+0 records out
real    0m 9.80s
user    0m 9.19s
sys     0m 0.00s

10+0 records in
10+0 records out
real    0m 9.99s
user    0m 9.36s
sys     0m 0.00s

dd: out of memory
Command exited with non-zero status 1
real    0m 0.00s
user    0m 0.00s
sys     0m 0.00s

[root@verify-diskext:/vmfs/volumes/642fb369-751670ce-c3a8-98f2b326a07c] \
> time dd bs=10K count=100000 if=/dev/urandom of=test ; echo ;\
> time dd bs=1K count=1000000 if=/dev/urandom of=test ; echo ;\
> time dd bs=100 count=10000000 if=/dev/urandom of=test ; echo
100000+0 records in
100000+0 records out
real    0m 9.81s
user    0m 9.20s
sys     0m 0.00s

1000000+0 records in
1000000+0 records out
real    0m 13.36s
user    0m 12.79s
sys     0m 0.00s

10000000+0 records in
10000000+0 records out
real    0m 50.21s
user    0m 49.41s
sys     0m 0.00s

[root@verify-diskext:/vmfs/volumes/642fb369-751670ce-c3a8-98f2b326a07c] \
> time dd bs=1M count=1000 if=/dev/urandom of=test ; echo ;\
> time dd bs=2M count=500 if=/dev/urandom of=test ; echo ;\
> time dd bs=4M count=250 if=/dev/urandom of=test ; echo ;\
> time dd bs=8M count=125 if=/dev/urandom of=test ; echo
1000+0 records in
1000+0 records out
real    0m 9.70s
user    0m 9.07s
sys     0m 0.00s

500+0 records in
500+0 records out
real    0m 9.77s
user    0m 9.11s
sys     0m 0.00s

250+0 records in
250+0 records out
real    0m 9.79s
user    0m 9.15s
sys     0m 0.00s

125+0 records in
125+0 records out
real    0m 9.78s
user    0m 9.19s
sys     0m 0.00s

[root@verify-diskext:/vmfs/volumes/642fb369-751670ce-c3a8-98f2b326a07c] \
> time dd bs=1000K count=1000 if=/dev/urandom of=test ; echo ;\
> time dd bs=900K count=1111 if=/dev/urandom of=test ; echo ;\
> time dd bs=800K count=1250 if=/dev/urandom of=test ; echo ;\
> time dd bs=700K count=1429 if=/dev/urandom of=test ; echo
1000+0 records in
1000+0 records out
real    0m 9.51s
user    0m 8.83s
sys     0m 0.00s

1111+0 records in
1111+0 records out
real    0m 9.50s
user    0m 8.81s
sys     0m 0.00s

1250+0 records in
1250+0 records out
real    0m 9.49s
user    0m 8.87s
sys     0m 0.00s

1429+0 records in
1429+0 records out
real    0m 9.48s
user    0m 8.82s
sys     0m 0.00s
0
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
0
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?