woyoudn 发表于 2019-1-26 15:07:52

修改Linux的open files参数是,立即生效,无需重启

  通过命令ulimit -a查看的open files参数的修改:
  # 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) 7697
  max locked memory       (kbytes, -l) 64
  max memory size         (kbytes, -m) unlimited
  open files                      (-n) 65535
  pipe size            (512 bytes, -p) 8
  POSIX message queues   (bytes, -q) 819200
  real-time priority            (-r) 0
  stack size            (kbytes, -s) 10240
  cpu time               (seconds, -t) unlimited
  max user processes            (-u) 1024
  virtual memory          (kbytes, -v) unlimited
  file locks                      (-x) unlimited

[*]  通过命令ulimit -n number可以直接修改,但是修改的只是当前会话的open files,重新打开一个连接查看的open files还是原来的。
[*]  修改配置文件/etc/security/limits.conf 添加
  *       soft    nofile65535
  *       hard    nofile65535
  注意格式,会立即生效,重新连接一下就可以看到了,ulimit -a。
  不需要重启,就会立即生效的。



页: [1]
查看完整版本: 修改Linux的open files参数是,立即生效,无需重启