Change limits LXC

authentic

New Member
Feb 3, 2021
1
0
0
30
Hello all,
i have small problem with my LXC ( CentOS + Nginx )

below nginx.error.log
Code:
setrlimit(RLIMIT_NOFILE, 51200) failed (1: Operation not permitted)

i try set manualy
Code:
[root@100 ~]# ulimit -n 65536
[root@100 ~]# ulimit -n
65536

Code:
[root@100 ~]# ps -ef | grep nginx
root       438     1  0 21:10 ?        00:00:00 nginx: master process /www/server/nginx/sbin/nginx -c /www/server/nginx/conf/nginx.conf
www        445   438  0 21:10 ?        00:00:00 nginx: worker process
www        446   438  0 21:10 ?        00:00:00 nginx: worker process
www        447   438  0 21:10 ?        00:00:00 nginx: cache manager process
root      1457    29  0 21:20 pts/1    00:00:00 grep --color=auto nginx
[root@100 ~]# cat /proc/445/limits
Limit                     Soft Limit           Hard Limit           Units    
Max cpu time              unlimited            unlimited            seconds  
Max file size             unlimited            unlimited            bytes    
Max data size             unlimited            unlimited            bytes    
Max stack size            8388608              unlimited            bytes    
Max core file size        0                    unlimited            bytes    
Max resident set          unlimited            unlimited            bytes    
Max processes             256695               256695               processes
Max open files            8192                 8192                 files    
Max locked memory         65536                65536                bytes    
Max address space         unlimited            unlimited            bytes    
Max file locks            unlimited            unlimited            locks    
Max pending signals       256695               256695               signals  
Max msgqueue size         819200               819200               bytes    
Max nice priority         0                    0                  
Max realtime priority     0                    0                  
Max realtime timeout      unlimited            unlimited            us      
[root@100 ~]# cat /proc/446/limits
Limit                     Soft Limit           Hard Limit           Units    
Max cpu time              unlimited            unlimited            seconds  
Max file size             unlimited            unlimited            bytes    
Max data size             unlimited            unlimited            bytes    
Max stack size            8388608              unlimited            bytes    
Max core file size        0                    unlimited            bytes    
Max resident set          unlimited            unlimited            bytes    
Max processes             256695               256695               processes
Max open files            8192                 8192                 files    
Max locked memory         65536                65536                bytes    
Max address space         unlimited            unlimited            bytes    
Max file locks            unlimited            unlimited            locks    
Max pending signals       256695               256695               signals  
Max msgqueue size         819200               819200               bytes    
Max nice priority         0                    0                  
Max realtime priority     0                    0                  
Max realtime timeout      unlimited            unlimited            us
 
Hi,
another user was nice enough to share how they did it. Hope it works for you too.