Skip to content

Add OS-level performance tuning for Elasticsearch#113

Merged
Oddly merged 4 commits intomainfrom
feat/os-tuning
Mar 28, 2026
Merged

Add OS-level performance tuning for Elasticsearch#113
Oddly merged 4 commits intomainfrom
feat/os-tuning

Conversation

@Oddly
Copy link
Copy Markdown
Owner

@Oddly Oddly commented Mar 27, 2026

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

Oddly added 4 commits March 27, 2026 23:17
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.
@Oddly Oddly merged commit db26955 into main Mar 28, 2026
52 checks passed
@Oddly Oddly deleted the feat/os-tuning branch March 28, 2026 13:28
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.

Add OS-level performance tuning for Elasticsearch

1 participant