This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 25408b1  [master-test] updated GetTableSchema() microbenchmark
25408b1 is described below

commit 25408b18c4836ae01fd7fa2b649facec2492d931
Author: Alexey Serbin <[email protected]>
AuthorDate: Sat May 9 20:36:57 2020 -0700

    [master-test] updated GetTableSchema() microbenchmark
    
    Updated GetTableSchema() RPC benchmark:
      * added histogram for the PRC latency
      * use multiple proxy to originate concurrent requests
    
    The updated results look like the following for a RELEASE build
    (microsecond is the unit for the histograms' values):
    
      GetTableSchema RPC: 105427.4 req/sec (authz disabled)
      Count: 527151
      Mean: 12.3581
      Percentiles:
         0%  (min) = 3
        25%        = 7
        50%  (med) = 9
        75%        = 14
        95%        = 21
        99%        = 65
        99.9%      = 231
        99.99%     = 406
        100% (max) = 7790
    
      GetTableSchema RPC: 39110.2 req/sec (authz enabled)
      Count: 195551
      Mean: 249.154
      Percentiles:
         0%  (min) = 56
        25%        = 72
        50%  (med) = 199
        75%        = 334
        95%        = 624
        99%        = 772
        99.9%      = 1176
        99.99%     = 2080
        100% (max) = 4172
    
    Change-Id: Ie49fd45f86b258ae4e441a3d3f272b5f52019169
    Reviewed-on: http://gerrit.cloudera.org:8080/15894
    Reviewed-by: Andrew Wong <[email protected]>
    Tested-by: Alexey Serbin <[email protected]>
---
 src/kudu/master/master-test.cc | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/src/kudu/master/master-test.cc b/src/kudu/master/master-test.cc
index a8adda3..875975b 100644
--- a/src/kudu/master/master-test.cc
+++ b/src/kudu/master/master-test.cc
@@ -79,6 +79,7 @@
 #include "kudu/util/curl_util.h"
 #include "kudu/util/env.h"
 #include "kudu/util/faststring.h"
+#include "kudu/util/hdr_histogram.h"
 #include "kudu/util/metrics.h"
 #include "kudu/util/monotime.h"
 #include "kudu/util/net/net_util.h"
@@ -124,6 +125,8 @@ DECLARE_int64(on_disk_size_for_testing);
 DECLARE_string(location_mapping_cmd);
 DECLARE_string(log_filename);
 
+METRIC_DECLARE_histogram(handler_latency_kudu_master_MasterService_GetTableSchema);
+
 namespace kudu {
 namespace master {
 
@@ -1104,6 +1107,25 @@ TEST_P(ConcurrentGetTableSchemaTest, Rpc) {
 
   AtomicBool done(false);
 
+  // Using multiple proxies to emulate multiple clients working concurrently,
+  // one proxy per a worker thread below. If using single proxy for all the
+  // threads instead, GetTableSchema() calls issued by the threads below
+  // would be serialized by that single proxy, not providing the required level
+  // of concurrency.
+  vector<unique_ptr<MasterServiceProxy>> proxies;
+  proxies.reserve(kNumTables);
+  for (auto i = 0; i < kNumTables; ++i) {
+    // No more than one reactor is needed since every worker thread below sends
+    // out a single GetTableSchema() request at a time; no other
+    // incoming/outgoing requests are handled by a worked thread.
+    MessengerBuilder bld("Client");
+    bld.set_num_reactors(1);
+    shared_ptr<Messenger> msg;
+    ASSERT_OK(bld.Build(&msg));
+    const auto& addr = mini_master_->bound_rpc_addr();
+    proxies.emplace_back(new MasterServiceProxy(std::move(msg), addr, 
addr.host()));
+  }
+
   // Start many threads that hammer the master with GetTableSchema() calls
   // for various tables.
   vector<thread> caller_threads;
@@ -1118,7 +1140,7 @@ TEST_P(ConcurrentGetTableSchemaTest, Rpc) {
       while (!done.Load()) {
         RpcController controller;
         GetTableSchemaResponsePB resp;
-        CHECK_OK(proxy_->GetTableSchema(req, &resp, &controller));
+        CHECK_OK(proxies[idx]->GetTableSchema(req, &resp, &controller));
         ++call_counters[idx];
         if (resp.has_error()) {
           LOG(WARNING) << "GetTableSchema failed: " << SecureDebugString(resp);
@@ -1142,6 +1164,11 @@ TEST_P(ConcurrentGetTableSchemaTest, Rpc) {
     FAIL() << Substitute("detected $0 errors", errors);
   }
 
+  const auto& ent = master_->metric_entity();
+  auto hist = METRIC_handler_latency_kudu_master_MasterService_GetTableSchema
+      .Instantiate(ent);
+  hist->histogram()->DumpHumanReadable(&LOG(INFO));
+
   const double total = accumulate(call_counters.begin(), call_counters.end(), 
0UL);
   LOG(INFO) << Substitute(
       "GetTableSchema RPC: $0 req/sec (authz $1)",

Reply via email to