Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Feb 9, 2024

Backport PR #15925 to 8.12 branch, original message:


Release notes

Updates Netty's configuration of maxOrder to a previously proven value, if not already customised by the user.

What does this PR do?

Adds a step to the JvmOption parsing tool, which is used to compose the JVM options string to pass down to Logstash at startup.
The added step rework the parsed options to set the allocator max order -Dio.netty.allocator.maxOrder=11 so that the maximum pooled buffer is up to 16MB and not 4MB.
This option is added iff it's not yet specified by the user

Why is it important/What is the impact to the user?

It brings back the performance of Netty based plugins to the same as of Logstash previous of 8.7.0, which introduced an update of Netty library.
With messages bigger then 2Kb each it triggered a problem of using unpooled buffers, which kills performance. With this change it moved back to 8Kb.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • [ ]

How to test this PR locally

The test splits in 2, verify that the line -Dio.netty.allocator.maxOrder=11 is added when the flag is not in config/jvm.options and verify that if the flag is already present it's not overwritten.
Run Logstash with

bin/logstash -e "input {stdin {}} output {stdout{}}"
  • first test: run Logstash and verify that the log that prints all the flag contains the redefinition of maxOrder
[INFO ][logstash.runner          ][main] JVM bootstrap flags: [-Xms4g,...-Dio.netty.allocator.maxOrder=11...

-second test: edit config/jvm.options and add a custom io.netty.allocator.maxOrder, start Logstash and verify logs contains the definition was added.

Related issues

Use cases

Screenshots

Logs

Updates Netty's configuration of maxOrder to a previously proven value, if not already customised by the user.

Adds a step to the JvmOption parsing tool, which is used to compose the JVM options string to pass down to Logstash at startup.
The added step rework the parsed options to set the allocator max order -Dio.netty.allocator.maxOrder=11 so that the maximum pooled buffer is up to 16MB and not 4MB.
This option is added iff it's not yet specified by the user

(cherry picked from commit 52ce3ff)
@elastic-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No Coverage information No data about Coverage
No Duplication information No data about Duplication

See analysis details on SonarQube

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

@andsel andsel merged commit 2a5c4c9 into 8.12 Feb 9, 2024
@jsvd jsvd deleted the backport_15925_8.12 branch March 11, 2024 09:35
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.

2 participants