리눅스, 디스크의 파일 읽고 쓰는 속도 측정 방법
---------------------------------------
< dd 이용 >
- 기능 충분
* 쓰기 속도
- # bs=1M (블록 크기) * count=1024 (횟수) = 1024MB = 1GB
$ dd if=/dev/zero of=파일명 bs=1M count=1024 oflag=direct
* 읽기 속도
- 캐시 삭제
$ sync && echo 3 | sudo tee /proc/sys/vm/drop_caches
- 읽기 속도 측정
$ dd if=파일명 of=/dev/null bs=1M iflag=direct
- 테스트후 파일 삭제
$ rm 파일명
---------------------------------------
<fio 유틸 사용>
sudo apt install fio
순차 쓰기/읽기 속도
# 1GB 파일 순차 쓰기 (Sequential Write)
fio --name=seq-write --rw=write --directory=/test/path --size=1G --bs=1M --ioengine=libaio --iodepth=64 --group_reporting
# 1GB 파일 순차 읽기 (Sequential Read)
fio --name=seq-read --rw=read --directory=/test/path --size=1G --bs=1M --ioengine=libaio --iodepth=64 --group_reporting
---------------------------------------
4K 랜덤 읽기/쓰기
# 1GB 파일 4K 랜덤 쓰기 (Random Write)
fio --name=rand-write --rw=randwrite --directory=/test/path --size=1G --bs=4k --ioengine=libaio --iodepth=64 --group_reporting
# 1GB 파일 4K 랜덤 읽기 (Random Read)
fio --name=rand-read --rw=randread --directory=/test/path --size=1G --bs=4k --ioengine=libaio --iodepth=64 --group_reporting
-------------------------------------------------------------------------------
[ 실제 측정 ]
< wsl 드라이브 >
- 쓰기
$ dd if=/dev/zero of=~/test_file bs=1M count=1024 oflag=direct
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.213007 s, 5.0 GB/s
$ sync && echo 3 | sudo tee /proc/sys/vm/drop_caches
- 읽기
$ dd if=~/test_file of=/dev/null bs=1M iflag=direct
dd if=~/test_file of=/dev/null bs=1M iflag=direct
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.16924 s, 6.3 GB/s
---------------------------------------
< wsl 에 마운트된 윈도우 드라이브 >
- 쓰기
$ dd if=/dev/zero of=/mnt/e/z/test_file bs=1M count=1024 oflag=direct
1024 oflag=direct
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 5.86076 s, 183 MB/s <=== 27배 느림
$ sync && echo 3 | sudo tee /proc/sys/vm/drop_caches
- 읽기
$ dd if=/mnt/e/z/test_file of=/dev/null bs=1M iflag=direct
direct
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 5.24713 s, 205 MB/s <=== 30배 느림
rm ~/test_file && rm /mnt/e/z/test_file
-------------------------------------------------------------------------------
[ fio 측정 ]
---------------------------------------
< wsl 드라이브 >
# 1GB 파일 순차 쓰기 (Sequential Write)
fio --name=seq-write --rw=write --directory=/home/ubuntu/z --size=1G --bs=1M --ioengine=libaio --iodepth=64 --group_reporting
WRITE: bw=1243MiB/s (1303MB/s)
# 1GB 파일 순차 읽기 (Sequential Read)
fio --name=seq-read --rw=read --directory=/home/ubuntu/z --size=1G --bs=1M --ioengine=libaio --iodepth=64 --group_reporting
READ: bw=3879MiB/s (4067MB/s)
# 1GB 파일 4K 랜덤 쓰기 (Random Write)
fio --name=rand-write --rw=randwrite --directory=/home/ubuntu/z --size=1G --bs=4k --ioengine=libaio --iodepth=64 --group_reporting
WRITE: bw=912MiB/s (956MB/s),
# 1GB 파일 4K 랜덤 읽기 (Random Read)
fio --name=rand-read --rw=randread --directory=/home/ubuntu/z --size=1G --bs=4k --ioengine=libaio --iodepth=64 --group_reporting
READ: bw=22.3MiB/s (23.4MB/s),
---------------------------------------
< wsl 에 마운트된 윈도우 드라이브 >
# 1GB 파일 순차 쓰기 (Sequential Write)
fio --name=seq-write --rw=write --directory=/mnt/e/z --size=1G --bs=1M --ioengine=libaio --iodepth=64 --group_reporting
WRITE: bw=177MiB/s (185MB/s), <== 7배 느림
# 1GB 파일 순차 읽기 (Sequential Read)
fio --name=seq-read --rw=read --directory=/mnt/e/z --size=1G --bs=1M --ioengine=libaio --iodepth=64 --group_reporting
READ: bw=191MiB/s (200MB/s) <== 20배 느림
# 1GB 파일 4K 랜덤 쓰기 (Random Write)
fio --name=rand-write --rw=randwrite --directory=/mnt/e/z --size=1G --bs=4k --ioengine=libaio --iodepth=64 --group_reporting
WRITE: bw=20.1MiB/s (21.1MB/s), <== 45배 느림
# 1GB 파일 4K 랜덤 읽기 (Random Read)
fio --name=rand-read --rw=randread --directory=/mnt/e/z --size=1G --bs=4k --ioengine=libaio --iodepth=64 --group_reporting
READ: bw=22.7MiB/s (23.8MB/s) <== 동일 ??
'Tips' 카테고리의 다른 글
| 윈도우11 PC를 블루투스 오디오 스피커로 사용하는 방법 (0) | 2025.11.13 |
|---|---|
| SpectraLayers 12, 라이브 공연에 들어간 소음 제거 (0) | 2025.11.08 |
| [OCR] 이미지를 글자로 변환 하기(윈도우 11 기본 기능) (0) | 2025.10.11 |
| premiere pro에서 export 시 주사선 생기는 현상 해결 (0) | 2025.08.30 |
| premiere pro, 블랙바가 안 생기게, 원래 재생 비율로 인코딩 하는 방법 (0) | 2025.08.30 |



