内核参数调整

ulimit 设置

命令说明

ulimit [-SHacdefilmnpqrstuvx]
参数S:表示软限制,当超过限制值会报警
参数H:表示硬限制,必定不能超过限制值
参数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) 15094
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) 15094
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

临时修改

ulimit -HSn 65536
ulimit -c unlimited

永久修改(limits.conf)

/etc/security/limits.conf

root soft nofile 65535
root hard nofile 65535
* soft nofile 65535
* hard nofile 65535