Improving NFS performance
I've setup my first NFS server to host Magento and loadbalance the web layer between two linodes.
Testing the read and write performance I'm finding very strange results.
This is the performance test I'm running (in separate folders of the nfs share):
time dd if=/dev/zero of=./zero1 bs=1M count=1000 oflag=direct
time dd if=./zero1 of=/dev/null iflag=direct bs=1M
time dd if=./zero1 of=./zero3 iflag=direct oflag=direct bs=1M
When running a single client I have near 30MBps write and near 30MBps read.
When running two clients against the same NFS server then on both servers I get near 30MBps writes and 15MBps read.
When running three clients against the same NFS server then on both servers I get near 30MBps writes and 10MBps read.
It must be something stupid. I played with the RSIZE and WSIZE, move from TCP to UDP with no success. These are the current settings after a lot of trials and barely any successes.
This is my setup:
NFSServerName (Linode 2048)
/etc/fstab
# datastore for nfs
/dev/xvdc /data/shared-data xfs noatime,nodiratime,logbufs=8,logbsize=256k,osyncisosync,nobarrier 0 1
# exporting those containers
/data/shared-data /export/shared-data bind noatime,nodiratime,defaults,bind 0 0
Each Client (Linode 2048)
/etc/fstab
# shared nfs storage
NFSServerName:/shared-data /srv/shared-data nfs rsize=65536,wsize=65536,intr,noatime,nodiratime,proto=tcp,port=2049,timeo=600,retrans=2 0 1
Any suggestions or ideas?
–
Jean-Marc
3 Replies
That would make a whole lot of sense except for when I run the test with two or three linodes as clients.
If I am reaching the maximum transfer speed between the linodes then I should see half the speed on both the write and the read (like 15MBps on all three tests with two linodes and something like 10MBps on all three tests with the three linodes). But, the tests show near 30MBps on write, and then 15MBbs on reads and RW. And with the three linodes they hover near 30MBps on write and then 10Mbps on read and RW.
The read and RW tests fully support you explanation… The write test is throwing me off.
btw, I already have a ticket open with them (that is the first thing I did). they were saying I'm not reaching the limit. I'll get back to them on that.
Any idea on why the results would not be consistent with the limit idea?
Thanks again,
--
Jean-Marc
That would explain why I am getting the results I am getting.