如何在Ubuntu 14.04上增加NFS v4的最大打开文件限制?

时间:2017-09-25 11:18:44

标签: ubuntu nfs

我研究了一些解决方案,特别是像mysqld这样的系统服务。

  1. 设置fs.file-max=1000000
  2. 在/etc/security/limits.conf上设置
  3. root  -     nofile         65535
    *     -     nofile         65535
    
    1. 在/etc/systemd/system.conf和/etc/systemd/user.conf上添加DefaultLimitNOFILE=65535

    2. nfs-kernel-server

    3. 添加systemd配置
      
          $ sudo systemctl edit nfs-kernel-server
          # Add following
          [Service]
          LimitNOFILE=65535
      
      

      重新启动后,nginx和mysqld在应用更改3.后运行良好。 但是,NFS的软/硬打开文件限制仍然是默认值。

      $ ps aux|grep nfs
      root     26694  0.0  0.0      0     0 ?        S   18:55   0:00 [nfsd4_callbacks]
      root     26696  0.0  0.0      0     0 ?        S    18:55   0:00 [nfsd]                     
      root     26697  0.0  0.0      0     0 ?        S    18:55   0:00 [nfsd]                     
      root     26698  0.0  0.0      0     0 ?        S    18:55   0:00 [nfsd]
      
      $ cat /proc/26696/limits |grep 'Max open files'                                             
      Max open files            1024                 4096                 files
      

0 个答案:

没有答案
相关问题