apache / kvrocks

Apache Kvrocks is a distributed key value NoSQL database that uses RocksDB as storage engine and is compatible with Redis protocol.
https://kvrocks.apache.org/
Apache License 2.0
3.47k stars 450 forks source link

[QUESTION]when will rocksdb.write_buffer_size be changed to 16 #286

Closed stutiredboy closed 3 years ago

stutiredboy commented 3 years ago

image

Version: 2.0.1 @5f41145a

I set target_file_size_base and rocksdb.write_buffer_size to 128 in kvrocks.conf then use config get to double check the value was set to 128.

But, some minutes later, the value was changed to 16, log in kvrocks.INFO

I0602 11:43:43.800396 11653 server.cc:1022] [server] Resize rocksdb.target_file_size_base from 128 to 16, average_kv_size: 15, total_size: 104606264039, total_keys: 6620970652, result: ok
I0602 11:43:45.627482 11653 server.cc:1038] [server] Resize rocksdb.write_buffer_size from 16 to 16, average_kv_size: 15, total_size: 104606264039, total_keys: 6620970652, result: ok

We can find that rocksdb.target_file_size_base was changed to 16, then rocksdb.write_buffer_size was changed to the same as rocksdb.target_file_size_base. And the most interesting is from 16 to 16 but not from 128 to 16, I'm quite sure the value for rocksdb.write_buffer_size in kvrocks.conf is 128 before kvrocks started.

Questions:

  1. when will this happen or this is a bug?
  2. what also can I do for your tracing
git-hulk commented 3 years ago

hi @stutiredboy Thanks for your feedback, kvrocks would auto-adjust the write_buffer_size by calculating the key-value size, see the related issue: https://github.com/bitleak/kvrocks/issues/118

As the second issue(the write buffer size from 16 to 16), we'll investigate and feedback here.

cc @karelrooted

ShooterIT commented 3 years ago

I think we maybe should provide one config to enable auto-adjust of the write_buffer_size and memtable, instead of always enable, because, users maybe have their own method or optimization strategy such as munual config

git-hulk commented 3 years ago

yeah, also the second issue was a bug that we didn't update the config. I'll submit a new issue for @karelrooted .

karelrooted commented 3 years ago

the old write_buffer_size in the log is a typo(use the newly setted value as old value), the auto-resize-block-and-sst config directive is added in PR: https://github.com/bitleak/kvrocks/pull/289