Hello Will Berkeley,

I'd like you to do a code review. Please visit

    http://gerrit.cloudera.org:8080/12614

to review the following change.


Change subject: KUDU-2711 (part 2): use a RWMutex for TSDescriptor
......................................................................

KUDU-2711 (part 2): use a RWMutex for TSDescriptor

One reason that GetTableLocations can end up slow is contention on the
TSDescriptor object.

This patch changes the spinlock to a RWMutex.

The benchmark improves throughput by about 33%:

  table_locations-itest --gtest_filter=\*Bench\*  \
    --benchmark_num_tablets 300 --benchmark_num_threads 30 \
    --benchmark_runtime_secs=10

before fix:
  Count: 16622
  Mean: 5365.24
  Percentiles:
     0%  (min) = 42
    25%        = 4928
    50%  (med) = 5280
    75%        = 5760
    95%        = 6368
    99%        = 6720
    99.9%      = 7904
    99.99%     = 8704
    100% (max) = 9870

with rwlock:
  Count: 22179
  Mean: 3901.19
  Percentiles:
     0%  (min) = 52
    25%        = 3600
    50%  (med) = 3904
    75%        = 4192
    95%        = 4608
    99%        = 4896
    99.9%      = 5760
    99.99%     = 10048
    100% (max) = 10661

Change-Id: Id48635e49f11d20fa1802b17a3ff5771632dfd01
---
M src/kudu/master/ts_descriptor.cc
M src/kudu/master/ts_descriptor.h
2 files changed, 21 insertions(+), 19 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/14/12614/1
--
To view, visit http://gerrit.cloudera.org:8080/12614
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id48635e49f11d20fa1802b17a3ff5771632dfd01
Gerrit-Change-Number: 12614
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Will Berkeley <[email protected]>

Reply via email to