I have a strange situation with the limits.memory:
When the memory size is ≥ 64GiB, it takes no effect, but once I had set another memory size, and set it 64GiB again, it will work:
The launch command:
lxc launch -p default -p k8s -s ssd dev-physical-0-19:centos-8-base dev-host-0-76-k8s-data-node -c limits.cpu=32 -c limits.memory=64GiB
Then the problem:
root@dev-physical-0-19:~# lxc exec dev-host-0-76-k8s-data-node -- sh -c "free -h "
total used free shared buff/cache available
Mem: 376Gi 77Mi 376Gi 42Mi 53Mi 376Gi
Swap: 0B 0B 0B
root@dev-physical-0-19:~# lxc config set dev-host-0-76-k8s-data-node limits.memory=64GiB
root@dev-physical-0-19:~# lxc exec dev-host-0-76-k8s-data-node -- sh -c "free -h "
total used free shared buff/cache available
Mem: 376Gi 77Mi 376Gi 42Mi 53Mi 376Gi
Swap: 0B 0B 0B
root@dev-physical-0-19:~# lxc config set dev-host-0-76-k8s-data-node limits.memory=48GiB
root@dev-physical-0-19:~# lxc exec dev-host-0-76-k8s-data-node -- sh -c "free -h "
total used free shared buff/cache available
Mem: 48Gi 77Mi 47Gi 42Mi 53Mi 47Gi
Swap: 0B 0B 0B
root@dev-physical-0-19:~# lxc config set dev-host-0-76-k8s-data-node limits.memory=64GiB
root@dev-physical-0-19:~# lxc exec dev-host-0-76-k8s-data-node -- sh -c "free -h "
total used free shared buff/cache available
Mem: 64Gi 77Mi 63Gi 42Mi 53Mi 63Gi
Swap: 0B 0B 0B
All of my lxd servers have the same problem.
ENV Info:
root@dev-physical-0-19:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 21.10
Release: 21.10
Codename: impish
root@dev-physical-0-19:~# lxd version
4.24
root@dev-physical-0-19:~# lxc profile show default
config: {}
description: Default LXD profile
devices:
eth0:
name: eth0
nictype: bridged
parent: br0
type: nic
root:
limits.read: 10000MB
limits.write: 10000MB
path: /
pool: lxc-storage
type: disk
name: default
used_by:
...
root@dev-physical-0-19:~# lxc profile show k8s
config:
boot.autostart: "true"
limits.memory.swap: "false"
linux.kernel_modules: ip_vs,ip_vs_rr,ip_vs_wrr,ip_vs_sh,ip_tables,ip6_tables,netlink_diag,nf_nat,overlay,br_netfilter
raw.lxc: |
lxc.apparmor.profile=unconfined
lxc.mount.auto=proc:rw sys:rw cgroup:rw
lxc.cgroup.devices.allow=a
lxc.cap.drop=
security.nesting: "true"
security.privileged: "true"
description: ""
devices:
aadisable:
path: /sys/module/nf_conntrack/parameters/hashsize
source: /sys/module/nf_conntrack/parameters/hashsize
type: disk
aadisable1:
path: /sys/module/apparmor/parameters/enabled
source: /dev/null
type: disk
aadisable2:
path: /dev/kmsg
source: /dev/kmsg
type: unix-char
aadisable3:
path: /sys/fs/bpf
source: /sys/fs/bpf
type: disk
aadisable4:
path: /proc/sys/net/netfilter/nf_conntrack_max
source: /proc/sys/net/netfilter/nf_conntrack_max
type: disk
name: k8s
used_by:
...
The logs of lxd service has nothing about this.