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

storage: configure allocator size class hints #123090

Closed
CheranMahalingam opened this issue Apr 25, 2024 · 2 comments · Fixed by #125793
Closed

storage: configure allocator size class hints #123090

CheranMahalingam opened this issue Apr 25, 2024 · 2 comments · Fixed by #125793
Assignees
Labels
A-storage Relating to our storage engine (Pebble) on-disk storage. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-storage Storage Team

Comments

@CheranMahalingam
Copy link
Contributor

CheranMahalingam commented Apr 25, 2024

cockroachdb/pebble#3508 added support for a new set of sstable flushing heuristics that can help reduce block cache internal fragmentation and the overall CockroachDB memory footprint. To reap the benefits we need to configure the default Pebble options at the Cockroach layer to specify the size classes supported by jemalloc once the Pebble version has been bumped (https://jemalloc.net/jemalloc.3.html#size_classes). This could look like,

opts.AllocatorSizeClasses = []int{
    16384,
    20480, 24576, 28672, 32768,
    40960, 49152, 57344, 65536,
    81920, 98304, 114688, 131072,
}

There are many more size classes that could be included, however, sstable blocks have a target block size of 32KiB, a minimum size threshold of ~19.6KiB and are unlikely to exceed 128KiB.

Jira issue: CRDB-38198

@CheranMahalingam CheranMahalingam added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-storage Relating to our storage engine (Pebble) on-disk storage. T-storage Storage Team labels Apr 25, 2024
@aadityasondhi
Copy link
Collaborator

We need to verify the CPU implications of this change through profiles. We could run kv0 with small (1B) block bytes and view CPU profiles.

@sumeerbhola
Copy link
Collaborator

https://github.com/cockroachlabs/support/issues/2908#issuecomment-2136029530 may be helped by this change (9.36GiB allocated instead of 8GiB).

@jbowens jbowens added this to Storage Jun 4, 2024
@jbowens jbowens moved this to Next in Storage Jun 4, 2024
aadityasondhi added a commit to aadityasondhi/cockroach that referenced this issue Jun 13, 2024
This patch makes use of the pebble size class aware flush heuristics
introduced in cockroachdb/pebble#3508. The
experimentation there showed improvements in internal fragmentation.

Fixes cockroachdb#123090.

Release note: None
craig bot pushed a commit that referenced this issue Jun 17, 2024
125793: storage: use jemalloc size classes when intializing pebble r=RaduBerinde a=aadityasondhi

This patch makes use of the pebble size class aware flush heuristics introduced in cockroachdb/pebble#3508. The experimentation there showed improvements in internal fragmentation.

Fixes #123090.

Release note: None

Co-authored-by: Aaditya Sondhi <20070511+aadityasondhi@users.noreply.github.com>
@craig craig bot closed this as completed in 2bdff39 Jun 17, 2024
@github-project-automation github-project-automation bot moved this from Next to Done in Storage Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-storage Relating to our storage engine (Pebble) on-disk storage. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-storage Storage Team
Projects
Archived in project
3 participants