sava
(Sava Radoš)
February 17, 2020, 12:55am
1
I know this is probably not possible, but I need to find a way to increase this value in an unpriviledged container.
From within container, the value is
ulimit -l
64
while on the host it’s
ulimit -l
65535
Is there a container setting or some other way I could increase this value in the container itself?
stgraber
(Stéphane Graber)
February 17, 2020, 1:18am
2
If on LXD, the limits.kernel. set of keys can be used for that.
stgraber
(Stéphane Graber)
February 17, 2020, 1:22am
3
https://linuxcontainers.org/lxd/docs/master/instances under Resource limits via limits.kernel.[limit name]
sava
(Sava Radoš)
February 17, 2020, 1:44am
4
I tried something like this
lxc config set container1 limits.kernel.memlock=65535
but it doesn’t seem to work.
ulimit -l shows 63
stgraber
(Stéphane Graber)
February 17, 2020, 3:07am
5
Can you show cat /proc/1/limits
after restarting the container once that limit is set?
sava
(Sava Radoš)
February 17, 2020, 12:29pm
6
Ah, thanks for the tip!
It seems that ulimit -l shows value in kilobytes while limits.kernel.memlock is in bytes.
I set
lxc config set container1 limits.kernel.memlock=67107840
and now
ulimit -l reports
65535
Sorry for the confusion, totally unrelated to lxd which works as expected.