[
https://issues.apache.org/jira/browse/HBASE-12684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14265727#comment-14265727
]
stack commented on HBASE-12684:
-------------------------------
I tried removing direct memory allocations. It removed allocation of memory
from showing in thread dumps (all threads seem to be in await now) but it made
no discernible difference.
Here is patch I put in place:
{code}
diff --git
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannel.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannel.java
index 56c9d03..8b3b6a3 100644
---
a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannel.java
+++
b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/AsyncRpcChannel.java
@@ -169,7 +169,7 @@ public class AsyncRpcChannel {
setupAuthorization();
- ByteBuf b = channel.alloc().directBuffer(6);
+ ByteBuf b = channel.alloc().buffer(6);
createPreamble(b, authMethod);
channel.writeAndFlush(b).addListener(ChannelFutureListener.CLOSE_ON_FAILURE);
if (useSasl) {
@@ -375,7 +375,7 @@ public class AsyncRpcChannel {
int totalSize = IPCUtil.getTotalSizeWhenWrittenDelimited(header);
- ByteBuf b = channel.alloc().directBuffer(totalSize);
+ ByteBuf b = channel.alloc().buffer(totalSize);
b.writeInt(header.getSerializedSize());
b.writeBytes(header.toByteArray());
@@ -424,7 +424,7 @@ public class AsyncRpcChannel {
totalSize += cellBlock.remaining();
}
- ByteBuf b = channel.alloc().directBuffer(totalSize);
+ ByteBuf b = channel.alloc().buffer(totalSize);
try(ByteBufOutputStream out = new ByteBufOutputStream(b)) {
IPCUtil.write(out, rh, call.param, cellBlock);
}
{code}
Here is perf summary:
{code}
Performance counter stats for '/home/stack/hadoop/bin/hadoop --config
/home/stack/conf_hadoop org.apache.hadoop.hbase.PerformanceEvaluation
--nomapred --rows=1000000 randomRead 5':
822798.522470 task-clock # 1.491 CPUs utilized
15,706,308 context-switches # 0.019 M/sec
1,354,772 CPU-migrations # 0.002 M/sec
105,150 page-faults # 0.128 K/sec
1,306,624,273,535 cycles # 1.588 GHz
[83.33%]
1,049,421,173,983 stalled-cycles-frontend # 80.32% frontend cycles idle
[83.32%]
739,796,823,721 stalled-cycles-backend # 56.62% backend cycles idle
[66.71%]
469,068,588,260 instructions # 0.36 insns per cycle
# 2.24 stalled cycles per insn
[83.38%]
89,889,582,957 branches # 109.249 M/sec
[83.32%]
4,785,354,251 branch-misses # 5.32% of all branches
[83.32%]
551.945102266 seconds time elapsed
{code}
The previous async run completed in 548 seconds (and the old client in
467seconds).
> Add new AsyncRpcClient
> ----------------------
>
> Key: HBASE-12684
> URL: https://issues.apache.org/jira/browse/HBASE-12684
> Project: HBase
> Issue Type: Improvement
> Components: Client
> Reporter: Jurriaan Mous
> Assignee: Jurriaan Mous
> Attachments: HBASE-12684-DEBUG2.patch, HBASE-12684-DEBUG3.patch,
> HBASE-12684-v1.patch, HBASE-12684-v10.patch, HBASE-12684-v11.patch,
> HBASE-12684-v12.patch, HBASE-12684-v13.patch, HBASE-12684-v14.patch,
> HBASE-12684-v15.patch, HBASE-12684-v16.patch, HBASE-12684-v17.patch,
> HBASE-12684-v17.patch, HBASE-12684-v18.patch, HBASE-12684-v19.1.patch,
> HBASE-12684-v19.patch, HBASE-12684-v19.patch, HBASE-12684-v2.patch,
> HBASE-12684-v3.patch, HBASE-12684-v4.patch, HBASE-12684-v5.patch,
> HBASE-12684-v6.patch, HBASE-12684-v7.patch, HBASE-12684-v8.patch,
> HBASE-12684-v9.patch, HBASE-12684.patch
>
>
> With the changes in HBASE-12597 it is possible to add new RpcClients. This
> issue is about adding a new Async RpcClient which would enable HBase to do
> non blocking protobuf service communication.
> Besides delivering a new AsyncRpcClient I would also like to ask the question
> what it would take to replace the current RpcClient? This would enable to
> simplify async code in some next issues.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)