Hi there! I have some questions about work of zram and LXC containters.
I have:
-
ubuntu 20.04, lxc 4.0.2, zram-tools 0.3.2.1-1
-
/dev/sdb with LVM where located test container
# swapon --show
NAME TYPE SIZE USED PRIO
/dev/zram0 partition 512M 1.9M 100
/dev/zram1 partition 512M 1.8M 100
/dev/zram2 partition 512M 1.5M 100
/dev/zram3 partition 512M 1.7M 100
/dev/zram4 partition 512M 1.6M 100
/dev/zram5 partition 512M 1.9M 100
/dev/zram6 partition 512M 1.9M 100
/dev/zram7 partition 512M 1.9M 100
# free -m
total used free shared buff/cache available
Mem: 32087 648 30636 2 803 31043
Swap: 4095 14 4081
# lxc-create -t download -n test1 -B lvm --vgname vg1 --fssize 6G --fstype ext4 -- -d centos -r 7 -a amd64
# lxc-start test1
# lxc-cgroup -n test1 memory.limit_in_bytes 1G
# lxc-attach test1
# yum install -y numpy
# cat <<EOF > memtest.py
#!/usr/bin/python2
import numpy
result = [numpy.random.bytes(1024*1024) for x in xrange(1900)]
print len(result)
EOF
# chmod +x memtest.py
# while true; do ./memtest.py ; done
And what i see? I see IO usage of sdb when container is swapping. Screens below.
Why is this happening? How to debug it? How to avoid it?