Why does not es use FileChannel2SocketChannel to recover shard?

Why does not es use FileChannel2SocketChannel to recover shard? which can eliminate the copy between user and kernel.
The only benefit that sending file though heap, i can think is to control sending rate. Is there any other reasons to do so?

Mainly simplicity. This isn't really an area that needs heavy optimisation, in fact it needs artificial throttling to limit the impact of recoveries on the rest of the system. There's some opportunity to save a bit of CPU here but it's just not really worth it.

Note that inter-node communications are typically encrypted and therefore need to be copied to userspace for decryption. I expect it will eventually be possible to offload the decryption work to the kernel (or even to dedicated hardware) but this is still only available in relatively new kernels and AFAIK not in the JDK yet.

1 Like

Thanks, it's resolved my puzzle.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.