[
https://issues.apache.org/jira/browse/RATIS-1931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17785204#comment-17785204
]
Duong commented on RATIS-1931:
------------------------------
I did a POC for zero-copy in GRPC (GrpcClientProtocolService and
GrpcServerProtocolService) and ran a test in Apache Ozone (container
replication). The source code is here:
[https://github.com/duongkame/ratis/commits/demo-zero-copy-grpc.]
The profiles before and after zero-copy are attached
([^datanode-on-write-ncopies.html] and [^datanode-on-write-zerocopy.html]).
Result:
* Zero-Copy improves ~14% of I/O performance in Ozone datanode for the
pure-write scenarios.
* The improvement comes from avoiding the cost of copying buffers during: (1)
parsing protobuf objects from inputstream and during writing WriteChunk data to
disks (when WriteChunk data is on heap, NIO has to copy the data to a direct
buffer before writing to disk).
* The improvement is also from a much lower GC footprint for zero copy, due to
avoiding intermediate buffers.
> Support Zero-Copy in ratis-grpc
> -------------------------------
>
> Key: RATIS-1931
> URL: https://issues.apache.org/jira/browse/RATIS-1931
> Project: Ratis
> Issue Type: Improvement
> Components: gRPC
> Reporter: Duong
> Priority: Major
> Attachments: datanode-on-write-ncopies.html,
> datanode-on-write-zerocopy.html
>
>
> As GRPC has stabilized the API for zero-copy for protobuf
> ([https://github.com/grpc/grpc-java/issues/7387),] it's possible to have such
> memory efficiency feature in Ratis GRPC.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)