The following code illustrates the issue at hand
This code is run as a single map-only task with an input file on disk and map-output to disk.
In the data node disk access patterns, the following consistent pattern was observed irrespective of bufferSize provided.
Here fd 58 is the incoming socket, 107 is the blk file and 108 is the .meta file.
The DFS packet size ignores the bufferSize argument and suffers from suboptimal syscall & disk performance because of the default 64kb value, as is obvious from the interrupted read/write operations.
Changing the packet size to a more optimal 1056405 bytes results in a decent spike in performance, by cutting down on disk & network iops.
That is by average an increase from ~115 MB/s to ~130 MB/s, by modifying the global packet size setting.
This suggests that there is value in adapting the user provided buffer sizes to hadoop packet sizing, per stream.