Skip to content

feat(playbooks/apache_solr): set vm.swappiness to 1 - #784

Merged
NavidSassan merged 1 commit into
mainfrom
feat/apache-solr-swappiness
Nov 19, 2026
Merged

NavidSassan merged 1 commit into
mainfrom
feat/apache-solr-swappiness

Conversation

@NavidSassan

Copy link
Copy Markdown
Member

The Solr Reference Guide recommends disabling swap or setting vm.swappiness to 1 ("Avoid Swapping" in "Taking Solr to Production"). With the distribution default (60, or 30 with TuneD's virtual-guest profile), the kernel swaps out idle parts of the Java heap while page cache is still available. On a host with a 4 GB heap on an 8 GB VM, the whole 2 GB swap ended up filled with Solr heap.

  • playbooks/apache_solr.yml runs kernel_settings, fed by apache_solr__kernel_settings__sysctl__dependent_var (vm.swappiness: 1), skippable via apache_solr__skip_kernel_settings. Same pattern as elasticsearch and mongodb.
  • No z00-after-tuned.conf: the kernel honours vm.swappiness continuously.
  • Breaking: on hosts that do not run kernel_settings yet, the playbook now also installs TuneD and applies its sysctl hardening baseline.

Tested: molecule test --scenario-name apache_solr/install on Debian 13 and Rocky 9, verify asserts /proc/sys/vm/swappiness is 1. The other targets and the solr10 scenario are not run yet.

@NavidSassan
NavidSassan merged commit fd29a0b into main Nov 19, 2026
14 checks passed
@NavidSassan
NavidSassan deleted the feat/apache-solr-swappiness branch November 19, 2026 11:06
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.

1 participant