1.ulimit -a
# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 128599
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 128599
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
2.查看配置文件
#sudo less /etc/security/limits.conf
# End of file
* soft nproc 65536
* hard nproc 65536
* soft nofile 65536
* hard nofile 65536
文档也设置了,但查看后,未生效。
3.设置全系统总限制fs.file-max=655360
# sudo cat /etc/sysctl.conf
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
net.ipv4.conf.all.accept_redirects=0
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward=1
fs.file-max=655360
4.立即生效
# sudo sysctl -p
net.ipv4.conf.all.accept_redirects = 0
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
fs.file-max = 655360
896

被折叠的 条评论
为什么被折叠?



