Ka matapakihia e tenei tuhinga pehea te mahi
Mo nga raruraru noa ki a Docker me o raatau otinga
Nga waahanga matua
- Ma te mahi tahi me te kaupapa motuhake, na reira ka whakarato i te whatunga, te mahara me te wehenga I / O, ka taea te kaha ki te whakamahi i te wehenga taputapu i runga i nga toronga mariko.
- Tautoko mo nga paerewa ahumahi tae atu ki te OCI (whakaahua ipu), Kubernetes CRI
- He rite tonu te mahi o nga ipu Linux auau, kua piki ake te noho wehe me te kore e eke ki runga ake o nga mahi o nga VM auau
- Whakamutua te hiahia ki te whakahaere ipu i roto i nga miihini mariko tino pai, ko nga atanga whanui ka ngawari te whakauru me te whakarewatanga
tāutanga
He
nui: Ko nga mahi a Kata Containers e tautokohia ana i runga i nga taputapu anake, kaore e mahi tonu te tuku whakamua mariko me tautoko sse4.1 mai i te pūtukatuka.
He ngawari noa te whakauru i nga Ipu Kata:
Whakauruhia nga taputapu mo te mahi me nga putunga:
# yum -y install yum-utils
Monohia a Selinux (he tika ake te whirihora, engari mo te ngawari ka whakakorehia e au):
# setenforce 0
# sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
Ka hono tatou i te putunga me te mahi i te whakaurunga
# 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
whakatikatikanga
Ka whakarite ahau ki te mahi me te docker, he angamaheni tana whakaurunga, kaore au e whakamaarama atu:
# 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
Ka huri tatou ki daemon.json:
# cat <<EOF > /etc/docker/daemon.json
{
"default-runtime": "kata-runtime",
"runtimes": {
"kata-runtime": {
"path": "/usr/bin/kata-runtime"
}
}
}
EOF
Tīmata anō te kaitautoko:
# service docker restart
Whakamātau Mahi
Mena ka timata koe i te ipu i mua i te whakaara ano i te docker, ka kite koe ka tukuna e uname te putanga o te kernel e rere ana i runga i te punaha matua:
# 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
Whai muri i te whakaara ano, ka penei te ahua o te putanga kernel:
# 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
Ētahi atu kapa!
# 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
Te whakamatautau uta tere
Hei aromatawai i nga mate mai i te mariko - Ka whakahaerehia e ahau te sysbench, hei tauira matua
Te whakahaere i te sysbench ma te whakamahi i te Docker+containerd
Whakamātautau pūtukatuka
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
whakamātautau RAM
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
Te whakahaere i te sysbench ma te whakamahi i te Docker+Kata Containers
Whakamātautau pūtukatuka
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
whakamātautau RAM
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
Ko te tikanga, kua marama te ahuatanga, engari he pai ake te whakahaere i nga whakamatautau i nga wa maha, te tango i nga waahanga me te whakatau toharite i nga hua, na reira kaore au e mahi i etahi atu whakamatautau.
kitenga
Ahakoa te mea e rima ki te tekau nga wa roa te roa o aua ipu ki te tiimata (te wa whakahaere mo nga whakahau rite ina whakamahi containerd he iti iho i te hautoru o te hekona), ka tere tonu te mahi mena ka tangohia e tatou te wa tiimata (kei reira he tauira i runga ake nei, ka mahia nga whakahau i roto i te toru hēkona toharite). Ana, ko nga hua o te whakamatautau tere o te PTM me te RAM e whakaatu ana i nga hua rite tonu, kaore e taea te koa, ina koa na te mea ka tukuna he wehenga ma te whakamahi i tetahi momo whakahaere pai penei i te kvm.
Panui
He arotake te tuhinga, engari ka whai waahi koe ki te rongo i te waa whakahaere rereke. He maha nga waahanga tono kaore i te kapi, hei tauira, ko te waahi e whakaatu ana i te kaha ki te whakahaere i nga Kubernetes ki runga ake o Kata Containers. I tua atu, ka taea hoki e koe te whakahaere i nga raupapa whakamatautau e arotahi ana ki te rapu raruraru haumarutanga, te whakarite here, me etahi atu mea whakamere.
Ka tono ahau ki te hunga katoa kua panui me te whakahoki ano i konei kia uru mai ki te rangahau, ko wai ka whakawhirinaki ki nga whakaputanga a muri ake nei mo tenei kaupapa.
Ko nga kaiwhakamahi kua rehita anake ka uru ki te rangahau.
Me whakaputa tonu au i nga tuhinga mo Kata Containers?
-
80,0 orauAe, tuhia mai ano!28
-
20,0 orauKao, kaua…7
35 nga kaiwhakamahi i pooti. 7 nga kaiwhakamahi i aukati.
Source: will.com