The other night I was trying to restart NFS services but then I received the following error messages:
kernel: [81818.428785] nfsd: unable to allocate nfsd_file_hashtbl rpc.nfsd: error starting threads: errno 12 (Cannot allocate memory) systemd: nfs-server.service: Main process exited, code=exited, status=1/FAILURE
That is a weird error to get considering that the system had 12+GB of RAM left in buff/cache. As far as I understand buff/cache memory - that is memory that is used by the kernel to cache information but still available to applications to use if they need RAM.
I then ran the following command:
sync && echo 3 > /proc/sys/vm/drop_caches
And the memory shifted from buff/cache to free and NFS started without any issues.
Everything that I'm reading suggests that is basically one of the worst things to do.
My question is that is this a bug in NFS or something else? It appears that this is a quite heated topic and I'm not arguing whether it is ok or not - all I can report is when I ran that NFS started without any issues and I am curious to know why.
I'm running Debian 10, with proxmox 6.3-6, NFS version 1:1.3.4-2.5+deb10u1
I have also noticed issues with proxmox (ie VNC console not working or can't connect to different nodes) - running that mentioned command on both of my nodes clears up all of those issues.