I recently set up a new nfs server, a proxmox6 VM with ceph as storage backend. The server itself is fast making read/write of > 300MBytes/sec possible on the local filesystems that are exported via NFS. NFS access however is very slow when writing is concerned: writing files, removing files etc. I created a test directory with 1.5 MB in size and ~300 small files in it:
nfsserver# mount|grep krienke
nfsserver:/user2/krienke on /home/krienke type nfs4 (rw,noatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=krb5,clientaddr=x.y.z.a,local_lock=none,addr=x.y.x.z.b)
# Copy via SSH to NFS directory on the nfsserver which NFS-automounts
# /export/user2/krienke on /home/krienke if accessed
client$ time scp -r etc nfsserver:/home/krienke/
real 2m34,598s
# No NFS involved:
client$ time scp -r etc nfsserver:/export/user2/krienke/
real 0m3,932s
You see the difference in execution time between non NFS access and access when NFS is involved. The same happens when I do NFS from a client machine. The NFS server is a SLES15SP1 machine with 10GB ethernet. The client has a 1Gbit interface. On the servers eth0 interface I see a view dropped packages which are about 0.003% of the totally xferred packages, which does not seem to be something to worry about. When copying the test-directory "etc" on the server itself not touching nfs the copy command is done immediately after having pressed ENTER. So for me it seems to a NFS related problem. I can reproduce this problem with both NFS V3 and NFS V4 access(the server exports both). Unlike writing, reading from NFS is fine.
One thing I see in nfsstat -s -v3 a quite high getattr value:
Server nfs v3:
null getattr setattr lookup access
4757 0% 9660323 84% 268638 2% 163260 1% 284994 2%
readlink read write create mkdir
396 0% 87230 0% 223067 1% 58621 0% 1799 0%
symlink mknod remove rmdir rename
25 0% 0 0% 40817 0% 903 0% 23826 0%
link readdir readdirplus fsstat fsinfo
0 0% 22242 0% 249358 2% 314048 2% 968 0%
pathconf commit
484 0% 33792 0%
My problem is up to now I did not find any kind of misconfiguration or such and I need some ideas where I could go searching for the source of this problem?
Thanks Rainer