Repository: kudu
Updated Branches:
refs/heads/master b167b98e4 -> ed45d7207
rpc: fix service lookup to use the proper lock type
Looking up the RPC service in the service map was using an exclusive
lock rather than a per-CPU read-lock.
Fixing this yielded a ~5% improvement on the average throughput
of rpc-bench. I ran:
rpc-bench --server-reactors 96 --async-call-concurrency 100 \
-worker-threads 40 -client-threads 48 -run-seconds 1 \
--gtest_filter=\*Async --gtest_repeat=100 2>&1 | tee /tmp/log
before and after the change. Running 100 short benchmarks is preferable
to a long one since this benchmark has quite a bit of variability
depending on reactor thread hashing, etc. I grepped out the reqs/sec
number and then ran a t-test using R:
data: d.before and d.after
t = -4.538, df = 165.27, p-value = 1.088e-05
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-59048.87 -23244.07
sample estimates:
mean of x mean of y
785314.9 826461.4
Special thanks to Sergei Politov from Yugabyte for finding this.
Change-Id: I871765dffc5208dbdfc6b7f9f7fa2160611631b9
Reviewed-on: http://gerrit.cloudera.org:8080/8478
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/10ed76cc
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/10ed76cc
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/10ed76cc
Branch: refs/heads/master
Commit: 10ed76cc1e31e0d226ee5411e738d6675072956a
Parents: b167b98
Author: Todd Lipcon <todd@apache.org>
Authored: Sun Nov 5 20:22:20 2017 -0800
Committer: Todd Lipcon <todd@apache.org>
Committed: Mon Nov 6 05:26:15 2017 +0000
----------------------------------------------------------------------
src/kudu/rpc/messenger.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/10ed76cc/src/kudu/rpc/messenger.cc
----------------------------------------------------------------------
diff --git a/src/kudu/rpc/messenger.cc b/src/kudu/rpc/messenger.cc
index 46b144f..1c8b5b2 100644
--- a/src/kudu/rpc/messenger.cc
+++ b/src/kudu/rpc/messenger.cc
@@ -567,7 +567,7 @@ void Messenger::ScheduleOnReactor(const boost::function<void(const
Status&)>& fu
const scoped_refptr<RpcService> Messenger::rpc_service(const string& service_name)
const {
scoped_refptr<RpcService> service;
{
- std::lock_guard<percpu_rwlock> guard(lock_);
+ shared_lock<rw_spinlock> guard(lock_.get_lock());
if (!FindCopy(rpc_services_, service_name, &service)) {
return scoped_refptr<RpcService>(nullptr);
}
|