You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2021/06/25 06:33:54 UTC

[GitHub] [incubator-pegasus] hycdong commented on a change in pull request #774: feat: add read/write amp perf-counter support

hycdong commented on a change in pull request #774:
URL: https://github.com/apache/incubator-pegasus/pull/774#discussion_r658507052



##########
File path: src/server/pegasus_server_impl.cpp
##########
@@ -46,6 +46,7 @@ namespace pegasus {
 namespace server {
 
 DEFINE_TASK_CODE(LPC_PEGASUS_SERVER_DELAY, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT)
+DSN_DECLARE_int32(read_amp_bytes_per_bit);

Review comment:
       I suggest this config mutable.

##########
File path: src/server/pegasus_server_impl.cpp
##########
@@ -2274,6 +2289,33 @@ void pegasus_server_impl::update_replica_rocksdb_statistics()
     dinfo_replica("_pfc_rdb_bf_point_negatives: {}", bf_point_negatives);
 }
 
+void pegasus_server_impl::update_replica_rocksdb_amp_statistics()
+{
+    // Update _pfc_rdb_write_amplification
+    std::map<std::string, std::string> props;
+    if (_db->GetMapProperty(_data_cf, "rocksdb.cfstats", &props)) {
+        auto write_amplification_iter = props.find("compaction.Sum.WriteAmp");
+        auto write_amplification = write_amplification_iter == props.end()
+                                       ? 1
+                                       : std::stod(write_amplification_iter->second);
+        _pfc_rdb_write_amplification->set(write_amplification);
+        dinfo_replica("_pfc_rdb_write_amplification: {}", write_amplification);
+    }
+
+    // Update _pfc_rdb_read_amplification
+    if (FLAGS_read_amp_bytes_per_bit > 0) {
+        auto estimate_useful_bytes =
+            _statistics->getTickerCount(rocksdb::READ_AMP_ESTIMATE_USEFUL_BYTES);

Review comment:
       https://github.com/facebook/rocksdb/blob/v6.6.4/monitoring/statistics.cc
   I notice that there are other statistics similar to what we like, such as `GET_HIT_L0`, `GET_HIT_L1`, `GET_HIT_L2_AND_UP`, what it the difference between them?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org