-
Notifications
You must be signed in to change notification settings - Fork 374
How to limit the memory of pod? #400
Comments
hi @weekface, the configuration is not being updated due to we dont add/remove memory after create a pod. The first container that is created in a pod is a Some work I started will help for this: The idea is to start a VM with a minimal amount of memory an then hot-plug memory as requested and limit the containers using cgroups. If a container does not provide a memory limit the runtime will hotadd Then when the This is related to #158 , I have work in progress related with this in https://github.com/jcvenegas/runtime-1/tree/memory-hotplug I will try to send the PR by the end of the week. There are still some things to define but that is a summary of what I have in mind about limit memory. |
@sboeuf In #388, you gave the impression that it was possible to limit the memory of a Pod with resource requests. Looking at what @jcvenegas it doesn't seem possible to do this with CRI-O - is that correct? If so, is anybody working on adding the ability to specify resource requests? |
@jamiehannaford you're correct. We can specify certain amount of CPUs but we don't have support for memory yet. |
@sboeuf What is the |
Default is 2048MiB. You can definitely use this to make sure you will restrict the amount of memory being used by your pods. I hope we'll have a more flexible way soon. |
Now, #470 and #303 have been merged, are we going to implement this feature(limiting the memory of pod) in the next release? @sboeuf @jcvenegas |
/cc @guangxuli |
Sounds good @miaoyq ! |
When create sandbox, we setup a sandbox of 128M base memory, and then hotplug memory that is needed for every new container. And we change the unit of c.config.Resources.Mem from MiB to Byte in order to prevent the 4095B < memory < 1MiB from being lost. Fixes kata-containers#400 Signed-off-by: Clare Chen <clare.chenhui@huawei.com> Signed-off-by: Zichang Lin <linzichang@huawei.com>
When create sandbox, we setup a sandbox of 128M base memory, and then hotplug memory that is needed for every new container. And we change the unit of c.config.Resources.Mem from MiB to Byte in order to prevent the 4095B < memory < 1MiB from being lost. Fixes kata-containers#400 Signed-off-by: Clare Chen <clare.chenhui@huawei.com> Signed-off-by: Zichang Lin <linzichang@huawei.com>
When create sandbox, we setup a sandbox of 2048M base memory, and then hotplug memory that is needed for every new container. And we change the unit of c.config.Resources.Mem from MiB to Byte in order to prevent the 4095B < memory < 1MiB from being lost. Fixes kata-containers#400 Signed-off-by: Clare Chen <clare.chenhui@huawei.com> Signed-off-by: Zichang Lin <linzichang@huawei.com>
When create sandbox, we setup a sandbox of 2048M base memory, and then hotplug memory that is needed for every new container. And we change the unit of c.config.Resources.Mem from MiB to Byte in order to prevent the 4095B < memory < 1MiB from being lost. Fixes kata-containers#400 Signed-off-by: Clare Chen <clare.chenhui@huawei.com> Signed-off-by: Zichang Lin <linzichang@huawei.com>
When create sandbox, we setup a sandbox of 2048M base memory, and then hotplug memory that is needed for every new container. And we change the unit of c.config.Resources.Mem from MiB to Byte in order to prevent the 4095B < memory < 1MiB from being lost. Fixes kata-containers#400 Signed-off-by: Clare Chen <clare.chenhui@huawei.com> Signed-off-by: Zichang Lin <linzichang@huawei.com>
When create sandbox, we setup a sandbox of 2048M base memory, and then hotplug memory that is needed for every new container. And we change the unit of c.config.Resources.Mem from MiB to Byte in order to prevent the 4095B < memory < 1MiB from being lost. Depends-on:github.com/kata-containers/tests#813 Fixes kata-containers#400 Signed-off-by: Clare Chen <clare.chenhui@huawei.com> Signed-off-by: Zichang Lin <linzichang@huawei.com>
When create sandbox, we setup a sandbox of 2048M base memory, and then hotplug memory that is needed for every new container. And we change the unit of c.config.Resources.Mem from MiB to Byte in order to prevent the 4095B < memory < 1MiB from being lost. Depends-on:github.com/kata-containers/tests#813 Fixes kata-containers#400 Signed-off-by: Clare Chen <clare.chenhui@huawei.com> Signed-off-by: Zichang Lin <linzichang@huawei.com>
proto: Split reusable structures into their own package
runtime: add pod overhead metrics
Description of problem
I followed this doc and created a pod with
1Gi
memory:Expected result
1Gi
memory allocated to this podActual result
But
2048M
was allocated:/usr/bin/qemu-lite-system-x86_64 -name sandbox-4da9da08bc50ca806898946cb19f6e5c8b35790b25d1e12e02738bc50e7a6f27 -uuid d7f7731b-fbaa-473d-bc54-515832cde672 -machine pc,accel=kvm,kernel_irqchip,nvdimm -cpu host -qmp unix:/run/vc/sbs/4da9da08bc50ca806898946cb19f6e5c8b35790b25d1e12e02738bc50e7a6f27/mon-d7f7731b-fbaa-473d-bc54-51,server,nowait -qmp unix:/run/vc/sbs/4da9da08bc50ca806898946cb19f6e5c8b35790b25d1e12e02738bc50e7a6f27/ctl-d7f7731b-fbaa-473d-bc54-51,server,nowait -m 2048M,slots=2,maxmem=129679M -device pci-bridge,bus=pci.0,id=pci-bridge-0,chassis_nr=1,shpc=on,addr=2 -device virtio-serial-pci,id=serial0 -device virtconsole,chardev=charconsole0,id=console0 -chardev socket,id=charconsole0,path=/run/vc/sbs/4da9da08bc50ca806898946cb19f6e5c8b35790b25d1e12e02738bc50e7a6f27/console.sock,server,nowait -device nvdimm,id=nv0,memdev=mem0 -object memory-backend-file,id=mem0,mem-path=/usr/share/kata-containers/kata-containers-image_clearlinux_agent_a099747.img,size=536870912 -device virtio-scsi-pci,id=scsi0 -device virtserialport,chardev=charch0,id=channel0,name=agent.channel.0 -chardev socket,id=charch0,path=/run/vc/sbs/4da9da08bc50ca806898946cb19f6e5c8b35790b25d1e12e02738bc50e7a6f27/kata.sock,server,nowait -device virtio-9p-pci,fsdev=extra-9p-kataShared,mount_tag=kataShared -fsdev local,id=extra-9p-kataShared,path=/run/kata-containers/shared/sandboxes/4da9da08bc50ca806898946cb19f6e5c8b35790b25d1e12e02738bc50e7a6f27,security_model=none -netdev tap,id=network-0,vhost=on,vhostfds=3:4:5:6:7:8:9:10,fds=11:12:13:14:15:16:17:18 -device driver=virtio-net-pci,netdev=network-0,mac=9e:63:15:fc:60:de,mq=on,vectors=18 -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -vga none -no-user-config -nodefaults -nographic -daemonize -kernel /usr/share/kata-containers/vmlinuz-4.14.22.1-130.1.container -append tsc=reliable no_timer_check rcupdate.rcu_expedited=1 i8042.direct=1 i8042.dumbkbd=1 i8042.nopnp=1 i8042.noaux=1 noreplace-smp reboot=k console=hvc0 console=hvc1 iommu=off cryptomgr.notests net.ifnames=0 pci=lastbus=0 root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro rw rootfstype=ext4 quiet systemd.show_status=false panic=1 initcall_debug nr_cpus=32 ip=::::::4da9da08bc50ca806898946cb19f6e5c8b35790b25d1e12e02738bc50e7a6f27::off:: init=/usr/lib/systemd/systemd systemd.unit=kata-containers.target systemd.mask=systemd-networkd.service systemd.mask=systemd-networkd.socket -smp 1,cores=1,threads=1,sockets=1,maxcpus=32
Meta details
Running
kata-collect-data.sh
version1.0.0 (commit de76c138bcc03442ce80312f1fc6365461241edf)
at2018-06-14.17:28:18.008997410+0800
.Runtime is
/usr/bin/kata-runtime
.kata-env
Output of "
/usr/bin/kata-runtime kata-env
":Runtime config files
Runtime default config files
Runtime config file contents
Config file
/etc/kata-containers/configuration.toml
not foundOutput of "
cat "/usr/share/defaults/kata-containers/configuration.toml"
":Image details
Initrd details
No initrd
Logfiles
Runtime logs
Recent runtime problems found in system journal:
Proxy logs
Recent proxy problems found in system journal:
Shim logs
Recent shim problems found in system journal:
Container manager details
Have
docker
Docker
Output of "
docker version
":Output of "
docker info
":Output of "
systemctl show docker
":No
kubectl
Packages
No
dpkg
Have
rpm
Output of "
rpm -qa|egrep "(cc-oci-runtimecc-runtimerunv|kata-proxy|kata-runtime|kata-shim|kata-containers-image|linux-container|qemu-)"
":The text was updated successfully, but these errors were encountered: