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

Update queue / ES connection defaults #36990

Merged
merged 5 commits into from
Nov 1, 2023
Merged

Conversation

faec
Copy link
Contributor

@faec faec commented Oct 30, 2023

Apply the remaining config defaults changes in https://github.com/elastic/ingest-dev/issues/2399, following the conclusion of the benchmark tests of the new values under varying input loads. Full discussion of the changes and associated benchmarks are in that issue. All changes are neutral or positive on all tests, both individually and in combination. The bulk_max_size change in particular gives a significant reduction in CPU use, while the timeout changes reduce average connection count for many use cases.

The full changes from this PR are:

Queue:

  • queue.mem.events: 4096 -> 3200
  • queue.mem.flush.min_events: 2048 -> 1600
  • queue.mem.flush.timeout: 1s -> 10s

ES output:

  • output.elasticsearch.bulk_max_size: 50 -> 1600
  • output.elasticsearch.idle_connection_timeout: 60s -> 3s

These changes will only take effect on configurations where the flags are unspecified. Any explicit user settings of these flags (in Beats or Agent) will override the values here.

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
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

@faec faec added breaking change Team:Elastic-Agent Label for the Agent team labels Oct 30, 2023
@faec faec self-assigned this Oct 30, 2023
@faec faec requested a review from a team as a code owner October 30, 2023 19:16
@faec faec requested review from belimawr and leehinman October 30, 2023 19:16
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Oct 30, 2023
@mergify
Copy link
Contributor

mergify bot commented Oct 30, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @faec? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@faec faec added the backport-skip Skip notification from the automated backport with mergify label Oct 30, 2023
@elasticmachine
Copy link
Collaborator

elasticmachine commented Oct 30, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-10-31T12:51:48.738+0000

  • Duration: 133 min 53 sec

Test stats 🧪

Test Results
Failed 0
Passed 28622
Skipped 2015
Total 30637

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@StephanErb
Copy link

Does that imply it is generally recommended to set queue.mem.flush.min_events == output.elasticsearch.bulk_max_size even for other bulk sizes?

@strawgate
Copy link
Contributor

Does that imply it is generally recommended to set queue.mem.flush.min_events == output.elasticsearch.bulk_max_size even for other bulk sizes?

Short answer is yes.
Long answer is that there are two constraints on min_events:

  1. min_events controls the size of the batch that gets dispatched to the output under load and so max_bulk_size can never actually be larger than min_flush and
  2. for best performance min_flush should be a multiple of max_bulk_size to ensure that the when the flush occurs it creates full batches for the output. In this case we're sticking with a multiple of 1 between max_bulk_size and min_flush

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Skip notification from the automated backport with mergify breaking change Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants