ehough / docker-nfs-server

A lightweight, robust, flexible, and containerized NFS server.
https://hub.docker.com/r/erichough/nfs-server/
GNU General Public License v3.0
672 stars 221 forks source link

NFS4 initial command performance #22

Closed ShahzadUmair closed 5 years ago

ShahzadUmair commented 5 years ago

The first command run on the mounted directory on client seems to take around a minute and a half to execute (touch hello.txt). All the commands run after the 1st command seems to execute normal. Do you happen to know what is causing this?

Docker run command:

docker run  --volume /data:/home --volume /tempData/exports.txt:/etc/exports:ro --privileged --env NFS_PORT=3001 -p 3001:3001 erichough/nfs-server

exports.txt

/home  *(rw,all_squash,anonuid=0,anongid=0,fsid=0)

Mount command

mount -o port=3001 -t nfs4 10.128.0.100:/ ./mnt

Interestingly enough, the 1st command runs normal when mounted as nfs3 (if i run server as nfs3 too).

ShahzadUmair commented 5 years ago

I figured it out. It's the grace period causing the initial delay.

ehough commented 5 years ago

Thanks for posting your resolution. I've never heard of the NFSv4 grace period. I'm going to see if there's a way that I can detect if the server is in the grace period and post a warning in the logs, just so others don't have to go through what you went through.