xglys 发表于 2018-11-16 10:43:09

nginx_Too many open files

  2014/08/05 08:53:49 13576#0: accept() failed (24: Too many open files)
  方法一:只对root和nodbdy用户增加该值。
  # vim /etc/security/limits.conf
  root soft nofile 10240
  root hard nofile 10240
  nobody soft nofile 10240
  nobody hard nofile 10240
  方法二:对所有用户增加该值
  # vim /etc/security/limits.conf
  * soft nofile 655360
  * hard nofile 655360
  编辑nginx配置文件
  # vim/usr/local/nginx/conf/nginx.conf
  worker_rlimit_nofile 10240;
  worker_connections 10240;
  注意:需要重启系统
  #lsof | wc -l
  1465
  # ulimit -a

  core file>
  data seg>  scheduling priority             (-e) 0

  file>  pending signals               (-i) 3675
  max locked memory       (kbytes, -l) 64

  max memory>  open files                      (-n) 10240

  pipe>  POSIX message queues   (bytes, -q) 819200
  real-time priority            (-r) 0

  stack>  cpu time               (seconds, -t) unlimited
  max user processes            (-u) 3675
  virtual memory          (kbytes, -v) unlimited
  file locks                      (-x
  临时生效 : ulimit -n 10240,将 系统可打开文件数量, 临时修改为 10240

页: [1]
查看完整版本: nginx_Too many open files