-
Notifications
You must be signed in to change notification settings - Fork 220
[runtime/iobuf/pool] improve buffer pool defaults #3860
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
Changes from 1 commit
ffff1c5
cb866e7
a2d8b1c
0921924
f865e52
afac103
970afb3
4a32127
82dac4d
05605a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -192,14 +192,13 @@ impl BufferPoolConfig { | |
| /// Cache-line alignment is used because network buffers don't require page | ||
| /// alignment for DMA, and smaller alignment reduces internal fragmentation. | ||
| pub const fn for_network() -> Self { | ||
| let cache_line = NZUsize!(cache_line_size()); | ||
| Self { | ||
| pool_min_size: 1024, | ||
| pool_min_size: 0, | ||
|
patrick-ogrady marked this conversation as resolved.
|
||
| min_size: NZUsize!(1024), | ||
| max_size: NZUsize!(64 * 1024), | ||
| max_size: NZUsize!(128 * 1024), | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not? This means this pool will use 1GB of memory at peak, same as the storage pool below. |
||
| max_per_class: NZU32!(4096), | ||
| prefill: false, | ||
| alignment: cache_line, | ||
| alignment: NZUsize!(1), | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't actually need any specific alignment here, and while this doesn't make any difference once the buffer is allocated and pooled the initial allocation is slower. |
||
| parallelism: NZUsize!(1), | ||
| thread_cache_config: BufferPoolThreadCacheConfig::Enabled(None), | ||
| } | ||
|
|
@@ -212,12 +211,12 @@ impl BufferPoolConfig { | |
| pub fn for_storage() -> Self { | ||
| let page = NZUsize!(page_size()); | ||
| Self { | ||
| pool_min_size: 1024, | ||
| pool_min_size: 0, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
| min_size: page, | ||
| max_size: NZUsize!(8 * 1024 * 1024), | ||
| max_per_class: NZU32!(64), | ||
| prefill: false, | ||
| alignment: page, | ||
| alignment: NZUsize!(1), | ||
|
patrick-ogrady marked this conversation as resolved.
cursor[bot] marked this conversation as resolved.
|
||
| parallelism: NZUsize!(1), | ||
| thread_cache_config: BufferPoolThreadCacheConfig::Enabled(None), | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pool is now faster than going to the system allocator, so there's no reason to bypass it in the defaults.