How to increase max open file limits for NFS v4 on Ubuntu 14.04?

Viewed 2035

I have researched for some solutions, especially the ones for system services like mysqld.

  1. Setup fs.file-max=1000000
  2. Setup following on /etc/security/limits.conf
root  -     nofile         65535
*     -     nofile         65535
  1. Add DefaultLimitNOFILE=65535 on /etc/systemd/system.conf and /etc/systemd/user.conf

  2. Add systemd config for nfs-kernel-server


    $ sudo systemctl edit nfs-kernel-server
    # Add following
    [Service]
    LimitNOFILE=65535

After reboot, nginx and mysqld work well after change 3. is applied. However NFS's soft/hard open file limits are still on default value.

$ 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 Answers
Related