로컬 개발 설정을 위해 Vagrant에서 Docker로 전환했을 때 처음으로 몇 가지 이상한 성능 효과를 발견했습니다.
이 새로운 환경에서 내 데이터베이스가 느려지는 이유를 조사한 후 Docker가 실제로 문제가 아니라는 결론을 내렸습니다. 실제로 제가 사용하는 NVME SSD(Samsung 970 EVO Plus)는 호스트보다 Vagrant VM에서 더 빠른 것 같은데... 이유는 모르겠습니다.
가상 머신과 호스트 머신 모두에서 동일한 sysbench fileio 테스트를 실행했습니다.
주인:
sysbench fileio --file-total-size=40G prepare
42949672960 bytes written in 42.35 seconds (967.12 MiB/sec).
가상 기기:
sysbench fileio --file-total-size=40G prepare
42949672960 bytes written in 26.71 seconds (1533.36 MiB/sec).
그 다음에:
주인:
sysbench fileio --file-total-size=40G --file-test-mode=rndrw --max-time=20 --max-requests=0 run
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Extra file open flags: (none)
128 files, 320MiB each
40GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...
Threads started!
File operations:
reads/s: 943.15
writes/s: 628.73
fsyncs/s: 2012.27
Throughput:
read, MiB/s: 14.74
written, MiB/s: 9.82
General statistics:
total time: 20.0357s
total number of events: 71688
Latency (ms):
min: 0.00
avg: 0.28
max: 17.35
95th percentile: 1.03
sum: 19934.06
Threads fairness:
events (avg/stddev): 71688.0000/0.00
execution time (avg/stddev): 19.9341/0.00
가상 기기:
sysbench fileio --file-total-size=40G --file-test-mode=rndrw --max-time=20 --max-requests=0 run
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Extra file open flags: (none)
128 files, 320MiB each
40GiB total file size
Block size 16KiB
Number of IO requests: 0
Read/Write ratio for combined random IO test: 1.50
Periodic FSYNC enabled, calling fsync() each 100 requests.
Calling fsync() at the end of test, Enabled.
Using synchronous I/O mode
Doing random r/w test
Initializing worker threads...
Threads started!
File operations:
reads/s: 2173.40
writes/s: 1448.94
fsyncs/s: 4637.65
Throughput:
read, MiB/s: 33.96
written, MiB/s: 22.64
General statistics:
total time: 20.0136s
total number of events: 165193
Latency (ms):
min: 0.00
avg: 0.12
max: 11.10
95th percentile: 0.45
sum: 19902.66
Threads fairness:
events (avg/stddev): 165193.0000/0.00
execution time (avg/stddev): 19.9027/0.00
이 동작의 원인 및/또는 테스트할 수 있는 항목을 아는 사람이 있습니까?