컨테이너 자원 할당 제한 - Block I/O

mohadang·2022년 4월 10일
0

도커

목록 보기
17/26
post-thumbnail

블록 입출력 절대 제한(--device-write-bps, --device-read-bps)

EX) --device-write-bps

$ docker run -it --device-write-bps /dev/xvda:1mb ubuntu:14.04
# root@97156027e991:/# dd if=/dev/zero of=test.out bs=1M count=10 oflag=direct
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 0.0365278 s, 1.0 MB/s

초당 제한을 설정하며 kb, mb, gb 단위로 제한 가능
단 Direct I/O의 경우에만 블록 입출력이 제한되며, Buffered I/O는 제한되지 않는다.

블록 입출력 상대 제한(--device-write-iops, --device-read-iops)

EX) --device-write-iops

$ docker run -it --device-write-iops /dev/xvda:5 ubuntu:14.04
# root@97156027e991:/# dd if=/dev/zero of=test.out bs=1M count=10 oflag=direct
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 0.0365278 s, 5.2 MB/s

// 제한이 2배, 작업 속도가 2배 빠름
$ docker run -it --device-write-iops /dev/xvda:10 ubuntu:14.04
# root@97156027e991:/# dd if=/dev/zero of=test.out bs=1M count=10 oflag=direct
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 0.0365278 s, 10.3 MB/s

블록 입출력 제한을 상대적으로 제한할 수 있다.

profile
mohadang

0개의 댓글