Slow NFS transfer performance of small files

Solution 1:

I don't have a lot of NFS experience, but my experience with other network file sharing protocols says that performance suffers in the "many small files" scenario nearly universally. You're incurring round-trip latency, and over a large group of files that latency adds up.

Solution 2:

There are many reasons why transferring many small files will always be slower than transferring a single large file. For a read, the files are more likely to be scattered around the disk, requiring seeks all over the place to get them. As Evan mentioned, there's also metadata involved in the case of NFS (or any other file system for that matter!) which also complicates things.

You can try increasing your rsize and wsize parameters to the NFS mount and see if that will help performance a bit. Also check out this question on tuning NFS for minimum latency as it has a lot of helpful advice that will help in the case of many small file transfers.


Solution 3:

Have you tried with a different filesystem, like XFS? It solved all my problems when doing extreme amounts of small iSCSI block transfers. No idea why.

Also, iSCSI/NFS is usually configured for pretty large dataframes (jumbo frames etc), it might hurt you if you are copying tiny files one at a time. Maybe tar'ing and then transfering would help you.