Systemctl configuration file connection number setting problem

1) If the number of connections for nofile is not configured in .service, the system's number of connections limit will be used

[root@localhost bin]# ulimit -n
1024
[root@localhost bin]# ulimit -Sn
1024
[root@localhost bin]# ulimit -Hn
4096

[root@localhost bin]# cat /proc/25168/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        unlimited            unlimited            bytes     
Max resident set          unlimited            unlimited            bytes     
Max processes             126386               126386               processes 
Max open files            1024                 4096                 files     
Max locked memory         65536                65536                bytes     
Max address space         unlimited            unlimited            bytes     
Max file locks            unlimited            unlimited            locks     
Max pending signals       126386               126386               signals   
Max msgqueue size         819200               819200               bytes     
Max nice priority         0                    0                    
Max realtime priority     0                    0                    
Max realtime timeout      unlimited            unlimited            us

 

2) If the number of connections of nofile is configured in .service, it will affect the limit of the number of connections of this process

[Service]
Restart=always
ExecStartPre=**********
ExecStart=**********
WorkingDirectory=**********
ExecReload=/bin/kill -HUP $MAINPID
ExecStopPost=**********
KillSignal=SIGKILL
LimitNOFILE = 150000
LimitCORE=infinity

[root@localhost bin]# cat /proc/20082/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        unlimited            unlimited            bytes     
Max resident set          unlimited            unlimited            bytes     
Max processes             126386               126386               processes 
Max open files            150000               150000               files     
Max locked memory         65536                65536                bytes     
Max address space         unlimited            unlimited            bytes     
Max file locks            unlimited            unlimited            locks     
Max pending signals       126386               126386               signals   
Max msgqueue size         819200               819200               bytes     
Max nice priority         0                    0                    
Max realtime priority     0                    0                    
Max realtime timeout      unlimited            unlimited            us  

 

 

 

Guess you like

Origin blog.csdn.net/zgb40302/article/details/107982454