You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "PragmaTwice (via GitHub)" <gi...@apache.org> on 2023/05/06 07:51:02 UTC

[GitHub] [incubator-kvrocks] PragmaTwice commented on a diff in pull request #1424: feat: rocksdb support auto tune with default config

PragmaTwice commented on code in PR #1424:
URL: https://github.com/apache/incubator-kvrocks/pull/1424#discussion_r1186659563


##########
src/storage/storage.cc:
##########
@@ -159,8 +159,19 @@ rocksdb::Options Storage::InitRocksDBOptions() {
   options.sst_file_manager = sst_file_manager_;
   int64_t max_io_mb = kIORateLimitMaxMb;
   if (config_->max_io_mb > 0) max_io_mb = config_->max_io_mb;
-  rate_limiter_ =
+  if (config_->rocks_db.rate_limiter_auto_tuned) {
+    rate_limiter_ =
+      std::shared_ptr<rocksdb::RateLimiter>(rocksdb::NewGenericRateLimiter(
+            max_io_mb * static_cast<int64_t>(MiB),
+            100 * 1000, /* default */
+            10, /* default */
+            rocksdb::RateLimiter::Mode::kWritesOnly,
+            true
+          ));
+  } else {
+    rate_limiter_ =
       std::shared_ptr<rocksdb::RateLimiter>(rocksdb::NewGenericRateLimiter(max_io_mb * static_cast<int64_t>(MiB)));
+  }

Review Comment:
   ```suggestion
     rate_limiter_ =
       std::shared_ptr<rocksdb::RateLimiter>(rocksdb::NewGenericRateLimiter(
             max_io_mb * static_cast<int64_t>(MiB),
             100 * 1000, /* default */
             10, /* default */
             rocksdb::RateLimiter::Mode::kWritesOnly,
             config_->rocks_db.rate_limiter_auto_tuned
           ));
   ```



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

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