I am assuming the following ways to copy a file with in a NFS share:
Process 1:
- The client requests for the data to be copied from NFS share (if cache is not there) and the chunks of data are asynchronously copied to memory of the NFS client which then asynchronously send it to the NFS filer again to copy to new location.
- The NFS filer receives the chunks of data asynchronously in the memory and writes it to the new location.
- In this process, though there is network involved while reading and also writing, due to asynchronous read & write, the latency for one overall read-write operation will be same as latency for read-write operation of overall data.
Hence, reading from local hard disk and writing to NFS is almost same as reading from NFS and write to NFS.
In the first step, if cache is already there, the reading can be very quick.
Process 2:
- The client send request to initiate the data copy operation to NFS server, along with the location from where it has to read and where it has to write (seems it is not).
- The server does the rest, read-write operations using it's own memory.
Hence, no network involved. And hence, can have better performance (unless there is no latency at the network end) But it is likely not the way.
Please correct me at every point, if I am wrong.
Also, does the memory involves at every operation, I mean when it sends data across network, the data is first sent to memory (data buffer) from disk and then from memory (data buffer) to data buffer (on the other side of the network), but not from data buffer to disk on the other side of the network right?