์ด ๊ธฐ์ฌ์์๋ ์๋ ๋ฐฉ์์ ๋ํด ์ค๋ช
ํฉ๋๋ค.
Docker ๋ฐ ํด๋น ์๋ฃจ์
์ ์ผ๋ฐ์ ์ธ ๋ฌธ์ ์ ๋ํด ์ด๋ฏธ
์ฃผ์ ๊ธฐ๋ฅ
- ๋ณ๋์ ์ฝ์ด๋ก ์์ ํ์ฌ ๋คํธ์ํฌ, ๋ฉ๋ชจ๋ฆฌ ๋ฐ I/O ๊ฒฉ๋ฆฌ๋ฅผ ์ ๊ณตํ๋ฏ๋ก ๊ฐ์ํ ํ์ฅ์ ๊ธฐ๋ฐ์ผ๋ก ํ๋์จ์ด ๊ฒฉ๋ฆฌ๋ฅผ ๊ฐ์ ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค.
- OCI(์ปจํ ์ด๋ ํ์), Kubernetes CRI๋ฅผ ํฌํจํ ์ฐ์ ํ์ค ์ง์
- ์ผ๋ฐ Linux ์ปจํ ์ด๋์ ์ผ๊ด๋ ์ฑ๋ฅ, ์ผ๋ฐ VM์ ์ฑ๋ฅ ์ค๋ฒํค๋ ์์ด ํฅ์๋ ๊ฒฉ๋ฆฌ
- ์์ ํ ๊ธฐ๋ฅ์ ๊ฐ์ถ ๊ฐ์ ๋จธ์ ๋ด์์ ์ปจํ ์ด๋๋ฅผ ์คํํ ํ์๊ฐ ์์ผ๋ฉฐ ์ผ๋ฐ ์ธํฐํ์ด์ค๊ฐ ํตํฉ ๋ฐ ์คํ์ ๋จ์ํํฉ๋๋ค.
์ค์น
์ด
์ค์ํ ์ผ์ด์ผ: Kata Containers ์์
์ ํ๋์จ์ด์์๋ง ์ง์๋๋ฉฐ, ๊ฐ์ํ ํฌ์๋ฉ์ด ํญ์ ์๋ํ๋ ๊ฒ์ ์๋๋ฉฐ, sse4.1 ์ง์ ํ์ ํ๋ก์ธ์์์.
Kata ์ปจํ ์ด๋ ์ค์น๋ ๋งค์ฐ ๊ฐ๋จํฉ๋๋ค.
๋ฆฌํฌ์งํ ๋ฆฌ ์์ ์ ์ํ ์ ํธ๋ฆฌํฐ๋ฅผ ์ค์นํฉ๋๋ค.
# yum -y install yum-utils
Selinux๋ฅผ ๋นํ์ฑํํฉ๋๋ค(๊ตฌ์ฑํ๋ ๊ฒ์ด ๋ ์ ํํ์ง๋ง ๊ฐ๋จํ๊ฒ ํ๊ธฐ ์ํด ๋นํ์ฑํํฉ๋๋ค).
# setenforce 0
# sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
์ ์ฅ์๋ฅผ ์ฐ๊ฒฐํ๊ณ ์ค์น๋ฅผ ์ํํฉ๋๋ค.
# source /etc/os-release
# ARCH=$(arch)
# BRANCH="${BRANCH:-stable-1.10}"
# yum-config-manager --add-repo "http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/${BRANCH}/CentOS_${VERSION_ID}/home:katacontainers:releases:${ARCH}:${BRANCH}.repo"
# yum -y install kata-runtime kata-proxy kata-shim
์กฐ์
docker์ ํจ๊ป ์๋ํ๋๋ก ๊ตฌ์ฑํ๊ณ ์ค์น๊ฐ ์ผ๋ฐ์ ์ด๋ฏ๋ก ๋ ์์ธํ ์ค๋ช ํ์ง ์๊ฒ ์ต๋๋ค.
# rpm -qa | grep docker
docker-ce-cli-19.03.6-3.el7.x86_64
docker-ce-19.03.6-3.el7.x86_64
# docker -v
Docker version 19.03.6, build 369ce74a3c
daemon.json์ ๋ณ๊ฒฝํฉ๋๋ค.
# cat <<EOF > /etc/docker/daemon.json
{
"default-runtime": "kata-runtime",
"runtimes": {
"kata-runtime": {
"path": "/usr/bin/kata-runtime"
}
}
}
EOF
๋์ปค๋ฅผ ๋ค์ ์์ํฉ๋๋ค.
# service docker restart
๊ธฐ๋ฅ ์ ๊ฒ
Docker๋ฅผ ๋ค์ ์์ํ๊ธฐ ์ ์ ์ปจํ ์ด๋๋ฅผ ์์ํ๋ฉด uname์ด ๊ธฐ๋ณธ ์์คํ ์์ ์คํ ์ค์ธ ์ปค๋ ๋ฒ์ ์ ์ ๊ณตํ๋ ๊ฒ์ ๋ณผ ์ ์์ต๋๋ค.
# docker run busybox uname -a
Linux 19efd7188d06 3.10.0-1062.12.1.el7.x86_64 #1 SMP Tue Feb 4 23:02:59 UTC 2020 x86_64 GNU/Linux
๋ค์ ์์ํ ํ ์ปค๋ ๋ฒ์ ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
# docker run busybox uname -a
Linux 9dd1f30fe9d4 4.19.86-5.container #1 SMP Sat Feb 22 01:53:14 UTC 2020 x86_64 GNU/Linux
๋ ๋ง์ ํ!
# time docker run busybox mount
kataShared on / type 9p (rw,dirsync,nodev,relatime,mmap,access=client,trans=virtio)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev type tmpfs (rw,nosuid,size=65536k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)
sysfs on /sys type sysfs (ro,nosuid,nodev,noexec,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,relatime,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (ro,nosuid,nodev,noexec,relatime,xattr,name=systemd)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (ro,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (ro,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (ro,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (ro,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/perf_event type cgroup (ro,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (ro,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/freezer type cgroup (ro,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/pids type cgroup (ro,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/cpuset type cgroup (ro,nosuid,nodev,noexec,relatime,cpuset)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
kataShared on /etc/resolv.conf type 9p (rw,dirsync,nodev,relatime,mmap,access=client,trans=virtio)
kataShared on /etc/hostname type 9p (rw,dirsync,nodev,relatime,mmap,access=client,trans=virtio)
kataShared on /etc/hosts type 9p (rw,dirsync,nodev,relatime,mmap,access=client,trans=virtio)
proc on /proc/bus type proc (ro,relatime)
proc on /proc/fs type proc (ro,relatime)
proc on /proc/irq type proc (ro,relatime)
proc on /proc/sys type proc (ro,relatime)
tmpfs on /proc/acpi type tmpfs (ro,relatime)
tmpfs on /proc/timer_list type tmpfs (rw,nosuid,size=65536k,mode=755)
tmpfs on /sys/firmware type tmpfs (ro,relatime)
real 0m2.381s
user 0m0.066s
sys 0m0.039s
# time docker run busybox free -m
total used free shared buff/cache available
Mem: 1993 30 1962 0 1 1946
Swap: 0 0 0
real 0m3.297s
user 0m0.086s
sys 0m0.050s
๋น ๋ฅธ ๋ถํ ํ ์คํธ
๊ฐ์ํ๋ก ์ธํ ์์ค์ ํ๊ฐํ๊ธฐ ์ํด - ์ฃผ์ ์๋ก sysbench๋ฅผ ์คํํฉ๋๋ค.
Docker+containerd๋ฅผ ์ฌ์ฉํ์ฌ sysbench ์คํ
ํ๋ก์ธ์ ํ ์คํธ
sysbench 1.0: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Prime numbers limit: 20000
Initializing worker threads...
Threads started!
General statistics:
total time: 36.7335s
total number of events: 10000
total time taken by event execution: 36.7173s
response time:
min: 3.43ms
avg: 3.67ms
max: 8.34ms
approx. 95 percentile: 3.79ms
Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 36.7173/0.00
๋จ ํ ์คํธ
sysbench 1.0: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Initializing worker threads...
Threads started!
Operations performed: 104857600 (2172673.64 ops/sec)
102400.00 MiB transferred (2121.75 MiB/sec)
General statistics:
total time: 48.2620s
total number of events: 104857600
total time taken by event execution: 17.4161s
response time:
min: 0.00ms
avg: 0.00ms
max: 0.17ms
approx. 95 percentile: 0.00ms
Threads fairness:
events (avg/stddev): 104857600.0000/0.00
execution time (avg/stddev): 17.4161/0.00
Docker+Kata ์ปจํ ์ด๋๋ฅผ ์ฌ์ฉํ์ฌ sysbench ์คํ
ํ๋ก์ธ์ ํ ์คํธ
sysbench 1.0: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Prime numbers limit: 20000
Initializing worker threads...
Threads started!
General statistics:
total time: 36.5747s
total number of events: 10000
total time taken by event execution: 36.5594s
response time:
min: 3.43ms
avg: 3.66ms
max: 4.93ms
approx. 95 percentile: 3.77ms
Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 36.5594/0.00
๋จ ํ ์คํธ
sysbench 1.0: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Initializing worker threads...
Threads started!
Operations performed: 104857600 (2450366.94 ops/sec)
102400.00 MiB transferred (2392.94 MiB/sec)
General statistics:
total time: 42.7926s
total number of events: 104857600
total time taken by event execution: 16.1512s
response time:
min: 0.00ms
avg: 0.00ms
max: 0.43ms
approx. 95 percentile: 0.00ms
Threads fairness:
events (avg/stddev): 104857600.0000/0.00
execution time (avg/stddev): 16.1512/0.00
์์น์ ์ผ๋ก ์ํฉ์ ์ด๋ฏธ ๋ช ํํ์ง๋ง ํ ์คํธ๋ฅผ ์ฌ๋ฌ ๋ฒ ์คํํ์ฌ ์ด์ ์น๋ฅผ ์ ๊ฑฐํ๊ณ ๊ฒฐ๊ณผ๋ฅผ ํ๊ท ํํ๋ ๊ฒ์ด ๋ ์ต์ ์ด๋ฏ๋ก ์์ง ๋ ๋ง์ ํ ์คํธ๋ฅผ ์ํํ์ง ์์ต๋๋ค.
์กฐ์ฌ ๊ฒฐ๊ณผ
์ด๋ฌํ ์ปจํ ์ด๋๋ ์์ํ๋ ๋ฐ ์ฝ XNUMX~XNUMX๋ฐฐ ๋ ์ค๋ ๊ฑธ๋ฆฐ๋ค๋ ์ฌ์ค์๋ ๋ถ๊ตฌํ๊ณ (containerd๋ฅผ ์ฌ์ฉํ ๋ ์ ์ฌํ ๋ช ๋ น์ ์ผ๋ฐ์ ์ธ ์คํ ์๊ฐ์ XNUMX/XNUMX์ด ๋ฏธ๋ง) ์ ๋ ์์ ์๊ฐ์ ์ทจํ๋ฉด ์ฌ์ ํ ๋งค์ฐ ๋น ๋ฅด๊ฒ ์๋ํฉ๋๋ค(๊ฑฐ๊ธฐ ์์ ์, ํ๊ท XNUMX์ด ๋ด์ ์ํ๋๋ ๋ช ๋ น). ์, CPU์ RAM์ ๋ํ ๋น ๋ฅธ ํ ์คํธ ๊ฒฐ๊ณผ๋ ๊ฑฐ์ ๋์ผํ ๊ฒฐ๊ณผ๋ฅผ ๋ณด์ฌ์ค๋๋ค. ํนํ kvm๊ณผ ๊ฐ์ด ์ ์คํ๋๋ ๋ฉ์ปค๋์ฆ์ ์ฌ์ฉํ์ฌ ๊ฒฉ๋ฆฌ๊ฐ ์ ๊ณต๋๋ค๋ ์ ์์ ๊ธฐ๋ปํ ์๋ฐ์ ์์ต๋๋ค.
๋ฐํ
๊ธ์ ๋ฆฌ๋ทฐ์ง๋ง ๋์ฒด๋ฐํ์์ ๋๋ ์ ์๋ ๊ธฐํ๋ฅผ ์ค๋๋ค. ์ ํ๋ฆฌ์ผ์ด์ ์ ๋ง์ ์์ญ์ ๋ค๋ฃจ์ง ์์ต๋๋ค. ์๋ฅผ ๋ค์ด ์ด ์ฌ์ดํธ์์๋ Kata ์ปจํ ์ด๋ ์์์ Kubernetes๋ฅผ ์คํํ ์ ์๋ ๊ฐ๋ฅ์ฑ์ ๋ํด ์ค๋ช ํฉ๋๋ค. ๋ํ ๋ณด์ ๋ฌธ์ ์ฐพ๊ธฐ, ์ ํ ์ค์ ๋ฐ ๊ธฐํ ํฅ๋ฏธ๋ก์ด ์ฌํญ์ ์ด์ ์ ๋ง์ถ ์ผ๋ จ์ ํ ์คํธ๋ฅผ ์คํํ ์๋ ์์ต๋๋ค.
๋๋ ์ฌ๊ธฐ์์ ์ฝ๊ณ ๋๊ฐ์ ๋ชจ๋ ์ฌ๋๋ค์๊ฒ ์ด ์ฃผ์ ์ ๋ํ ํฅํ ์ถํ๋ฌผ์ด ์์กดํ ์ค๋ฌธ ์กฐ์ฌ์ ์ฐธ์ฌํ๋๋ก ์์ฒญํฉ๋๋ค.
๋ฑ๋ก๋ ์ฌ์ฉ์๋ง ์ค๋ฌธ ์กฐ์ฌ์ ์ฐธ์ฌํ ์ ์์ต๋๋ค.
Kata ์ปจํ ์ด๋์ ๋ํ ๊ธฐ์ฌ๋ฅผ ๊ณ์ ๊ฒ์ํด์ผ ํฉ๋๊น?
-
80,0%๋ค, ๋ ์จ์ฃผ์ธ์!28
-
20,0%์๋, ํ์ง๋ง...7
35๋ช
์ ์ฌ์ฉ์๊ฐ ํฌํํ์ต๋๋ค. 7๋ช
์ ์ฌ์ฉ์๊ฐ ๊ธฐ๊ถํ์ต๋๋ค.
์ถ์ฒ : habr.com