go
cat /etc/security/limits.conf | grep -Ev "^$|#"
量
go
# ulimit -n
1024000
- 软限制的打开文件数
go
# ulimit -Sn
1024000
- 硬限制的打开文件数量
go
# ulimit -Hn
1024000
- 系统打开文件描述符的最大数量
go
# sysctl fs.nr_open
fs.nr_open = 1048576
- 系统打开文件的最大数量
go
# sysctl fs.file-max
fs.file-max = 9223372036854775807
- 软限制的打开文件数量
- 硬限制的打开文件数量
go
sudo echo "* soft nofile 32000000" >> /etc/security/limits.conf
sudo echo "* hard nofile 128000000" >> /etc/security/limits.conf
- 系统打开文件描述符的最大数量
- 系统打开文件的最大数量
go
sudo echo "fs.nr_open=128000000" >> /etc/sysctl.conf
# sudo echo "fs.file-max=128000000" >> /etc/sysctl.conf
- 重新加载/etc/sysctl.conf文件
go
sysctl -p