Michael Ho has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/8895 )

Change subject: KUDU-1865: Avoid some heap allocations in RPC paths
......................................................................


Patch Set 2:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/8895/2//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/8895/2//COMMIT_MSG@16
PS2, Line 16: central cache list in TCMalloc and causes spin lock contention.
> would be good to accompany this with some benchmark results
I can look into rpc-bench. The perf infrastructure I have been using is down 
recently so I cannot run the typical TPC-H and TPC-DS benchmark at this point.

An anecdotal data point is a stress test which used to take 86 mins went down 
to about 57 mins but it's not quite scientific measurement.


http://gerrit.cloudera.org:8080/#/c/8895/2//COMMIT_MSG@21
PS2, Line 21: Introduce a new interface RpcContext::RespondSuccess(const 
Message& message)
            :   which allows callers to pass the response PB directly as 
argument instead
            :   of using the preallocated response PB owned by RpcContext. This 
allows callers
            :   to allocate the response PB on the stack, thus avoiding the 
need to use the heap.
> I'm not so keen on this API change here. It seems a bit messy to have two d
Yes, I am not too keen on having two APIs either. In fact, I wonder if there is 
a reason why all existing calls to RespondSuccess() cannot switch over to using 
the new interface and deprecate the old interface. The few RPCs I looked at 
seem to be easy to convert but there may be tricky ones which I didn't look at. 
This seems to make sense to me and we can get rid of the allocation for the 
response buffer in GeneratedServiceIf::Handle().

I haven't used 'Arena' before so would you mind explaining how it would help 
here. Does it allocate a large enough chunk to satisfy the allocations for 
request and other items so the malloc() call will be amortized ? So, in other 
words, heap allocations are still needed.

I will split the interface change out as a separate change.


http://gerrit.cloudera.org:8080/#/c/8895/2/src/kudu/rpc/connection.cc
File src/kudu/rpc/connection.cc:

http://gerrit.cloudera.org:8080/#/c/8895/2/src/kudu/rpc/connection.cc@430
PS2, Line 430:   scoped_refptr<Connection> conn_;
> is this required for correctness in this patch?
Yes. I ran into a case in rpc-test in which the dtor of InboundCall() 
recursively calls into the dtor of 'conn_' in which the 'inbound_call_pool_' 
resides.



--
To view, visit http://gerrit.cloudera.org:8080/8895
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I407b4782c9f3cd39ad3c6e0d21fd9542be34b118
Gerrit-Change-Number: 8895
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Ho <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Michael Ho <[email protected]>
Gerrit-Reviewer: Mostafa Mokhtar <[email protected]>
Gerrit-Reviewer: Sailesh Mukil <[email protected]>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <[email protected]>
Gerrit-Comment-Date: Thu, 21 Dec 2017 06:32:50 +0000
Gerrit-HasComments: Yes

Reply via email to