Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions be/src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,8 @@ DEFINE_mBool(enable_delete_when_cumu_compaction, "false");

// max_write_buffer_number for rocksdb
DEFINE_Int32(rocksdb_max_write_buffer_number, "5");
// bytes_per_sec for rocksdb rate limiter
DEFINE_Int64(rocksdb_rate_limiter_bytes_per_sec, "1048576"); // 1MB/s

DEFINE_mBool(allow_zero_date, "false");
DEFINE_Bool(allow_invalid_decimalv2_literal, "false");
Expand Down
2 changes: 2 additions & 0 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,8 @@ DECLARE_mBool(enable_delete_when_cumu_compaction);

// max_write_buffer_number for rocksdb
DECLARE_Int32(rocksdb_max_write_buffer_number);
// bytes_per_sec for rocksdb rate limiter
DECLARE_Int64(rocksdb_rate_limiter_bytes_per_sec);

// Convert date 0000-00-00 to 0000-01-01. It's recommended to set to false.
DECLARE_mBool(allow_zero_date);
Expand Down
5 changes: 5 additions & 0 deletions be/src/io/cache/cache_block_meta_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

#include "common/status.h"
#include "exec/common/hex.h"
#include "rocksdb/rate_limiter.h"
#include "storage/field.h"
#include "storage/field.h" // For OLAP_FIELD_TYPE_BIGINT
#include "storage/key_coder.h"
Expand Down Expand Up @@ -88,6 +89,10 @@ Status CacheBlockMetaStore::init() {
_options.write_buffer_size = 64 * 1024 * 1024; // 64MB
_options.target_file_size_base = 64 * 1024 * 1024;

auto bytes_per_sec = config::rocksdb_rate_limiter_bytes_per_sec;
_options.rate_limiter.reset(rocksdb::NewGenericRateLimiter(
bytes_per_sec, 100 * 1000, 10, rocksdb::RateLimiter::Mode::kWritesOnly, true));

rocksdb::BlockBasedTableOptions table_options;
table_options.filter_policy.reset(rocksdb::NewBloomFilterPolicy(10, false));
table_options.block_size = 16 * 1024;
Expand Down
5 changes: 5 additions & 0 deletions be/src/storage/olap_meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "rocksdb/convenience.h"
#include "rocksdb/db.h"
#include "rocksdb/options.h"
#include "rocksdb/rate_limiter.h"
#include "rocksdb/slice.h"
#include "rocksdb/slice_transform.h"
#include "runtime/runtime_profile.h"
Expand Down Expand Up @@ -83,6 +84,10 @@ Status OlapMeta::init() {
options.info_log = std::make_shared<RocksdbLogger>();
options.info_log_level = rocksdb::WARN_LEVEL;

auto bytes_per_sec = config::rocksdb_rate_limiter_bytes_per_sec;
options.rate_limiter.reset(rocksdb::NewGenericRateLimiter(
bytes_per_sec, 100 * 1000, 10, rocksdb::RateLimiter::Mode::kWritesOnly, true));

std::string db_path = _root_path + META_POSTFIX;
std::vector<ColumnFamilyDescriptor> column_families;
// default column family is required
Expand Down
Loading