kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

Add a option to specify write_buffer_size for minor column families

Open jjz921024 opened this issue 1 year ago • 7 comments
trafficstars

For #2193

Add a lite_mode option to special kvrock running at lite_mode, At this mode, the lite_opts will replace for subkey_opts on some infrequently used column families for reduce memory usage in some scenarios.

jjz921024 avatar Apr 20 '24 10:04 jjz921024

@jjz921024 Thanks for your contributions.

git-hulk avatar Apr 20 '24 11:04 git-hulk

I believe "lite mode" is not a suitable name as it does not clearly convey its purpose.

We should find a more specific name instead of labeling any random behavior as "lite mode".

PragmaTwice avatar Apr 20 '24 11:04 PragmaTwice

I believe "lite mode" is not a suitable name as it does not clearly convey its purpose.

We should find a more specific name instead of labeling any random behavior as "lite mode".

Maybe we can rename this option to reduce_infrequently_column_memory_usage so that explicitly tell the user that it is used to reduce the memory size of an infrequently used column family?

jjz921024 avatar Apr 23 '24 13:04 jjz921024

I believe "lite mode" is not a suitable name as it does not clearly convey its purpose. We should find a more specific name instead of labeling any random behavior as "lite mode".

Maybe we can rename this option to reduce_infrequently_column_memory_usage so that explicitly tell the user that it is used to reduce the memory size of an infrequently used column family?

It can be minor_columns_write_buffer_size num.

PragmaTwice avatar Apr 25 '24 10:04 PragmaTwice

@jjz921024 I'm good with this implementation.

git-hulk avatar Apr 26 '24 11:04 git-hulk

@jjz921024 Maybe a simpler way is:

  1. Config an extra "rocksdb.minor_write_buffer_size" as extra arguments, it can be a bit smaller
  2. "default" and "metadata" cf is "major", other column families are "minor"
  3. Adjust the size for these two parts. There are two kinds of ways: (1) using same default "rocksdb.minor_write_buffer_size", or even a smaller "rocksdb.minor_write_buffer_size", and separate the two args. This would nice for new user and most users, since it could reducing the arg here and just improve some performance (2) Using current way, this would be good for some extra user who adjusted the write_buffer_size previously

Personally (3) is a bit hard but I think these CF should be tuned themselves in the future, maintaining two configs both for "minor"( like if "rocksdb.write_buffer_size" is set and "rocksdb.minor_write_buffer_size" doesn't set, using "rocksdb.write_buffer_size", and otherwise separate them) is better for users, but might be a bit tricky. Maybe we can separate it into other patch?

Thanks for the efforts!

mapleFU avatar Apr 28 '24 15:04 mapleFU