Kernel and sysctl tuning baseline: OL 10 defaults measured, and the usual adjustment points for database workloads
What you will learn
Section titled “What you will learn”What the kernel’s measured defaults look like on a fresh OL 10 install, which scenarios touch which parameters, and how to persist changes so they survive a reboot.
The default baseline (measured on a minimal install)
Section titled “The default baseline (measured on a minimal install)”sysctl vm.swappiness vm.overcommit_memory vm.max_map_count fs.file-maxvm.swappiness = 60vm.overcommit_memory = 0vm.max_map_count = 1048576fs.file-max = 9223372036854775807| Parameter | Default | Meaning | When to change |
|---|---|---|---|
| vm.swappiness | 60 | the swap tendency | drop to 1~10 on database machines; leave alone on memory-rich general servers |
| vm.overcommit_memory | 0 | heuristic overcommit | databases (Oracle/PG) recommend 2 + overcommit_ratio |
| vm.max_map_count | 1048576 | the memory-mapping segment cap | Elasticsearch-class apps want 262144+ (the default already suffices) |
| kernel.numa_balancing | 0 | automatic NUMA balancing | off for database core-pinning scenarios; on is fine for general multi-tenant |
| fs.file-max | the system-wide file-handle cap | new kernels set it to an enormous value | basically leave alone; adjust ulimit instead |
THP and HugePages: the two switches for database scenarios
Section titled “THP and HugePages: the two switches for database scenarios”cat /sys/kernel/mm/transparent_hugepage/enabled# [always] madvise nevergrep HugePages /proc/meminfo# HugePages_Total: 0 Hugepagesize: 2048 kBMeasured defaults: THP=always, static hugepages=0. The common advice (matching Oracle database’s official installation requirements and PG tuning practice):
- THP → madvise (or never): database processes do not benefit from transparent hugepages’ background compaction, which instead introduces latency spikes;
- Static HugePages: reserve according to the database’s SGA/shared_buffers size,
vm.nr_hugepages = N.
The two changes differ in mechanism — THP is a /sys switch (a grubby kernel parameter transparent_hugepage=madvise or a boot script), while HugePages is a sysctl (hot-settable but affected by memory fragmentation; boot-time reservation is recommended).
Persisting: put drop-ins in /etc/sysctl.d
Section titled “Persisting: put drop-ins in /etc/sysctl.d”# Example: a database machine's baselinecat > /etc/sysctl.d/90-db-tuning.conf <<'EOF'vm.swappiness = 10vm.overcommit_memory = 2vm.overcommit_ratio = 90vm.nr_hugepages = 4096EOFsysctl --system # full reload (covers the /usr/lib, /run and /etc layers)Verify: sysctl vm.swappiness reads back directly. Do not write /etc/sysctl.conf (the legacy location, sorted last — drop-ins are the current convention).
Relation to tuned
Section titled “Relation to tuned”dnf install -y tuned && tuned-adm activetuned offers profile-based tuning (throughput-performance, virtual-guest, database…), which in essence writes sysctls and power policies for you. Pick one path: either a tuned profile governs globally, or hand-written sysctl.d — mixing them invites odd regressions where a profile overwrites your hand-written values. The default OL install (minimal) ships without tuned; the Server environment group includes it.
Evidence and limits on this page
Section titled “Evidence and limits on this page”- Measured: the default baseline, the THP/HugePages state, tuned’s absence (E3);
- Not measured: a database load benchmark before/after HugePages reservation (no database workload environment available);
- Sources: Oracle database Linux installation requirements, OL10 performance tuning documentation,
sysctl.d(5).