]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add an outstanding_requests perf counter 38283/head
authorDan van der Ster <daniel.vanderster@cern.ch>
Wed, 25 Nov 2020 13:27:31 +0000 (14:27 +0100)
committerDan van der Ster <daniel.vanderster@cern.ch>
Wed, 25 Nov 2020 13:35:20 +0000 (14:35 +0100)
Expose the outstanding_requests variable so we can more easily tune rgw_max_concurrent_requests.

Related-to: https://tracker.ceph.com/issues/48358
Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
src/rgw/rgw_dmclock_async_scheduler.cc
src/rgw/rgw_dmclock_async_scheduler.h
src/rgw/rgw_dmclock_scheduler_ctx.cc
src/rgw/rgw_dmclock_scheduler_ctx.h

index e11362aa4c3842fc5a9f61dfddd9cf249d7dcd01..28738e9f3ab9199c6b79b22454592338534ba6fa 100644 (file)
@@ -62,6 +62,9 @@ int AsyncScheduler::schedule_request_impl(const client_id& client,
 void AsyncScheduler::request_complete()
 {
   --outstanding_requests;
+  if(auto c = counters(client_id::count)){
+    c->inc(throttle_counters::l_outstanding, -1);
+  }
   schedule(crimson::dmclock::TimeZero);
 }
 
@@ -138,6 +141,9 @@ void AsyncScheduler::process(const Time& now)
       break;
     }
     ++outstanding_requests;
+    if(auto c = counters(client_id::count)){
+      c->inc(throttle_counters::l_outstanding);
+    }
 
     // complete the request
     auto& r = pull.get_retn();
index 20c04a666796f39b420a2f94f2fd8085f8774eb2..7bbb943a93ba919a9a9b7263d1df1ed3aff1e6a8 100644 (file)
@@ -191,6 +191,11 @@ public:
 
   void request_complete() override {
     --outstanding_requests;
+    if (auto c = counters();
+        c != nullptr) {
+      c->inc(throttle_counters::l_outstanding, -1);
+    }
+
   }
 
 private:
@@ -200,6 +205,7 @@ private:
     if (outstanding_requests++ >= max_requests) {
       if (auto c = counters();
           c != nullptr) {
+        c->inc(throttle_counters::l_outstanding);
         c->inc(throttle_counters::l_throttle);
       }
       return -EAGAIN;
index 0a1286cfbdacf93cf1f4b84ea6984ea0e4bdea0e..cc1170eb184a9695f303ab4884309378f74ce2dc 100644 (file)
@@ -168,6 +168,7 @@ PerfCountersRef build(CephContext *cct, const std::string& name)
 
   PerfCountersBuilder b(cct, name, l_first, l_last);
   b.add_u64(l_throttle, "throttle", "Requests throttled");
+  b.add_u64(l_outstanding, "outstanding", "Outstanding Requests");
 
   auto logger = PerfCountersRef{ b.create_perf_counters(), cct };
   cct->get_perfcounters_collection()->add(logger.get());
index 9284a4dc7e40ba10961304d01e33ef8597cb9e6f..be3b2cc279415da14c70f4ff6852bf05008e7f8f 100644 (file)
@@ -36,6 +36,7 @@ namespace throttle_counters {
   enum {
         l_first = 437219,
         l_throttle,
+        l_outstanding,
         l_last
   };