NFS reads vs. writes

Julian Elischer julian at freebsd.org
Mon Jan 4 17:19:14 UTC 2016


On 3/01/2016 10:00 AM, Mikhail T. wrote:
> I have two similar 10.2-STABLE machines mounting each other's
> filesystems via NFS: a:/a and b:/b
>
> When moving some large files around today, I found a huge discrepancy
> between writing and reading over NFS. That is, machine a copying files
> from its own /a to NFS-mounted b:/b was pushing measly 2-3Mb/s over the
> Ethernet. When I cancelled that, logged-in to machine b and proceed to
> copy from a:/a to the now-local /b, I got 56Mb/s. I tried changing the
> wsize and rsize options, but it did not seem to make a difference...
>
> Any ideas, what is happening here? Why are NFS-writes some 25 times
> slower here, than reads? Both filesystems are zfs-backed (though with
> different options), both systems are plugged into the same switch, both
> use mtu of 9000.
look at the work from the point of view of each machine:

If A is writing to B's filesystem, it needs to wait synchronously for 
each write to complete before doing the next. (that's what NFS does by 
default).
If B is reading from A's filesystem it can read the next bloc as soon 
as it has read the previous, and in fact given that there is 
read-ahead logic at several layers, it's probably not even waiting 
that long, but queuing up (at one end or the other) requests to disk 
faster than they can be satisfied.

Basically the reads are parallelised and the writes are async in the B 
case.

I see Rick has replied too.

>
> Thanks! Yours,
>
>      -mi
>
> _______________________________________________
> freebsd-fs at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe at freebsd.org"
>



More information about the freebsd-fs mailing list