Add OS-level performance tuning for Elasticsearch#113
Merged
Conversation
Adds an elasticsearch_os_tuning toggle (default: true) that applies production-required sysctl settings: - vm.max_map_count=262144 (required for mmapfs, ES refuses to start) - vm.swappiness=1 (prevent heap from being swapped) - net.ipv4.tcp_retries2=5 (faster fault detection, ~13s vs ~15min) - Transparent Huge Pages disabled (runtime + persistent via tmpfiles) The THP disable uses failed_when: false for containers where sysfs is read-only. Verify assertions added to elasticsearch_default scenario. Closes #60
The sysctl and THP tasks fail in Docker/LXC containers because the kernel tunables are read-only in unprivileged containers. Skip these tasks when virtualization_type indicates a container runtime, and guard the verify assertions accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds sysctl settings required for production Elasticsearch: vm.max_map_count, vm.swappiness, TCP retries, and THP disable. Controlled by elasticsearch_os_tuning (default: true). Test coverage in elasticsearch_default scenario.
Closes #60