Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce the number of write buffers for infrequently used column families #2193

Open
1 of 2 tasks
git-hulk opened this issue Mar 23, 2024 · 9 comments
Open
1 of 2 tasks
Assignees
Labels
enhancement type enhancement good first issue Good for newcomers help wanted Good for newcomers

Comments

@git-hulk
Copy link
Member

Search before asking

  • I had searched in the issues and found no similar issues.

Motivation

Currently, all column families are shared the same number of write buffers
which is unnecessary for infrequently used column families including pubsub,
propagte, and zset_score. We can keep them to a const value like 1 to reduce
the memory usage in some scenarios.

Solution

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@git-hulk git-hulk added enhancement type enhancement help wanted Good for newcomers good first issue Good for newcomers labels Mar 23, 2024
@LiuYuHui
Copy link
Contributor

Please assign it to me, thanks a lot :D

@git-hulk
Copy link
Member Author

@LiuYuHui Thank you!

@git-hulk
Copy link
Member Author

git-hulk commented Apr 9, 2024

Hi @LiuYuHui Are you still working on this issue?

@LiuYuHui
Copy link
Contributor

LiuYuHui commented Apr 9, 2024

Hi @git-hulk, I have had no extra time bandwidth recently, please feel free to assign it to other people.

@git-hulk
Copy link
Member Author

@LiuYuHui Thanks for your quick response. Welcome back while you get time.

@git-hulk git-hulk assigned git-hulk and unassigned LiuYuHui Apr 10, 2024
@jjz921024
Copy link
Contributor

Hi @git-hulk , May i question? How do we implement this feature?

  1. For each column family add a config, specifying its number of write buffers. eg: pubsub.max_write_buffer_numberpropagte.max_write_buffer_numberzset_score.max_write_buffer_number ...
  2. Add a lite mode config, When this config is set to true, create a new lite_table_opts for infrequently used column families. like:
rocksdb::BlockBasedTableOptions lite_table_opts = InitTableOptions();
rocksdb::ColumnFamilyOptions lite_opts(subkey_opts);
lite_opts.write_buffer_size = 32 * MiB;
lite_opts.max_write_buffer_number = 0;

// replace subkey_opts with lite_opts 
column_families.emplace_back(kZSetScoreColumnFamilyName, lite_opts);
column_families.emplace_back(kPubSubColumnFamilyName, lite_opts);
column_families.emplace_back(kPropagateColumnFamilyName, lite_opts);
column_families.emplace_back(kStreamColumnFamilyName, lite_opts);```

@git-hulk
Copy link
Member Author

git-hulk commented Apr 11, 2024

@jjz921024 Yes, I'm good with this implementation. Would you like to submit a PR?

@jjz921024
Copy link
Contributor

Yes, I want to try

@git-hulk git-hulk assigned jjz921024 and unassigned git-hulk Apr 12, 2024
@git-hulk
Copy link
Member Author

@jjz921024 Assigned, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement type enhancement good first issue Good for newcomers help wanted Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants