I am writing data to a NFS device.
My problem is that somtimes, the write() call can take a while (2 seconds...).
But I don't understand why, beacause it should be buffered in the kernel.
If I look at /proc/meminfo, Dirty and Writeback are moving between 0 and 50MB.
50MB is 10% of the available memory (dirty_background_ratio). So how can the write block, if the buffer is far from being full ?

In my application I have 10 threads writing to the same NFS device, at about 2Mb/s each. And my NFS device and network can work faster than 20Mb/s.
The NFS server is set in async mode.

I have these blocking writes when the NFS device is busy writing in its disks. But I would expect, on client side, that the kernel buffer data and don't block the write operation from my application.