lxc-nofiles-limit

Shibili K

Member
Aug 28, 2018
5
0
21
47
How do I set ulimit -n more than 65536 in a lxc (centos 7 template) running on Proxmox 6.0.4 version?

I can setup unto 65536 using /etc/security/limit.conf. How do I set a value upto 100000?
 
Hi,
try adding the following line to your container configuration file (in /etc/pve/lxc/<ID>.conf):
Code:
lxc.prlimit.nofile: 100000
Then you should be able to raise the limit within the container to 10000 as well.
 
Thank you,
If we add lxc.prlimit.nofile: 100000 in /etc/pve/lxc/<ID>.conf is it required lxc restart? or is it reflect without restart lxc?
 
If you really don't want to restart, use
Code:
pstree -p $(lxc-info -Hp -n <ID>)
to see the process tree of your container, use
Code:
prlimit -p <PID>
prlimit --nofile=100000 -p <PID>
to check and set the limits of the relevant process(es).