Skip to content

Use CPU count to calculate default no. of buffer processors#17737

Merged
thll merged 8 commits into
masterfrom
add/dynamic-number-of-buffer-processors
Jan 11, 2024
Merged

Use CPU count to calculate default no. of buffer processors#17737
thll merged 8 commits into
masterfrom
add/dynamic-number-of-buffer-processors

Conversation

@thll

@thll thll commented Dec 18, 2023

Copy link
Copy Markdown
Contributor

Calculate default values for process-buffer and output-buffer processors based on the number of CPU cores available to the JVM.

The new defaults will be calculated as illustrated by this graph:

image

(Highlighted rows represent the predetermined values from #17450.

Fixes #17450

If the number of detected cores is not correct, there are several ways to address that:

  • Adding -XX:ActiveProcessorCount as a JVM argument, e.g. -XX:ActiveProcessorCount=2
  • For docker, running with the --cpus flag, e.g --cpus=2

TODO:

  • After merging this, check if the Forwarder needs adjustments

@thll thll marked this pull request as ready for review December 19, 2023 08:58
@thll thll requested review from bernd and mpfz0r December 19, 2023 08:58

@mpfz0r mpfz0r left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.
We have quite a few places where we set these defaults.
https://github.com/search?q=org%3AGraylog2%20processbuffer_processors&type=code

We need to check and potentially remove those

Comment thread graylog2-server/src/main/java/org/graylog2/Configuration.java Outdated
Comment thread graylog2-server/src/main/java/org/graylog2/plugin/BaseConfiguration.java Outdated
@thll thll requested a review from bernd January 8, 2024 10:25

@bernd bernd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the update! I have one small comment regarding the changelog. The rest looks good! 👍

Comment thread changelog/unreleased/issue-17450.toml Outdated
Co-authored-by: Bernd Ahlers <bernd@users.noreply.github.com>
@thll thll requested a review from bernd January 11, 2024 10:48
@thll thll merged commit 83a876a into master Jan 11, 2024
@thll thll deleted the add/dynamic-number-of-buffer-processors branch January 11, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change default thread buffer config

3 participants