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

Changed the partition_status chunked_fifo chunk size to 8 #16247

Merged
merged 3 commits into from
Jan 24, 2024

Conversation

mmaslankaprv
Copy link
Member

@mmaslankaprv mmaslankaprv commented Jan 23, 2024

With large number of topics that contain a small amount of partitions we
may end up wasting a lot of memory using the default ss::chunked_fifo
chunk size of 128.
Change the chunk size of partition_status chunked_fifo collection to
8 to minimize a waste with large number of small topics.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.3.x
  • v23.2.x
  • v23.1.x

Release Notes

Improvements

  • smaller memory footprint when using with large number of topics with small partition count

travisdowns
travisdowns previously approved these changes Jan 23, 2024
Copy link
Member

@travisdowns travisdowns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as a stop-gap until we have a better structure.

This will at least reduce memory use by ~16x for 1-partition topics, which should be enough to push the memory use down to a reasonable value (maybe ~100 MB ish).

andrwng
andrwng previously approved these changes Jan 23, 2024
@rockwotj
Copy link
Contributor

LGTM as a stop-gap until we have a better structure.

We basically want a structure has the memory usage of std::vector until some threshold (say 64KiB or something) then allocate full chunks right?

andrwng
andrwng previously approved these changes Jan 23, 2024
@piyushredpanda
Copy link
Contributor

Still see some build failures

@piyushredpanda piyushredpanda added this to the v23.2.24 milestone Jan 24, 2024
Signed-off-by: Michal Maslanka <michal@redpanda.com>
Signed-off-by: Michal Maslanka <michal@redpanda.com>
With large number of topics that contain a small amount of partitions we
may end up wasting a lot of memory using the default `ss::chunked_fifo`
chunk size of 128.
Change the chunk size of `partition_status` `chunked_fifo` collection to
8 to minimize a waste with large number of small topics.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
@vbotbuildovich
Copy link
Collaborator

@mmaslankaprv mmaslankaprv merged commit 1ffeb79 into redpanda-data:dev Jan 24, 2024
17 checks passed
@mmaslankaprv mmaslankaprv deleted the partition_status_chunk branch January 24, 2024 10:55
@vbotbuildovich
Copy link
Collaborator

/backport v23.3.x

@vbotbuildovich
Copy link
Collaborator

/backport v23.2.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants