Skip to content
Search Oracle Linux

    Browse this documentation

    Kernel and sysctl tuning baseline: OL 10 defaults measured, and the usual adjustment points for database workloads

    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)”
    Terminal window
    sysctl vm.swappiness vm.overcommit_memory vm.max_map_count fs.file-max
    vm.swappiness = 60
    vm.overcommit_memory = 0
    vm.max_map_count = 1048576
    fs.file-max = 9223372036854775807
    ParameterDefaultMeaningWhen to change
    vm.swappiness60the swap tendencydrop to 1~10 on database machines; leave alone on memory-rich general servers
    vm.overcommit_memory0heuristic overcommitdatabases (Oracle/PG) recommend 2 + overcommit_ratio
    vm.max_map_count1048576the memory-mapping segment capElasticsearch-class apps want 262144+ (the default already suffices)
    kernel.numa_balancing0automatic NUMA balancingoff for database core-pinning scenarios; on is fine for general multi-tenant
    fs.file-maxthe system-wide file-handle capnew kernels set it to an enormous valuebasically 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”
    Terminal window
    cat /sys/kernel/mm/transparent_hugepage/enabled
    # [always] madvise never
    grep HugePages /proc/meminfo
    # HugePages_Total: 0 Hugepagesize: 2048 kB

    Measured 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).

    Terminal window
    # Example: a database machine's baseline
    cat > /etc/sysctl.d/90-db-tuning.conf <<'EOF'
    vm.swappiness = 10
    vm.overcommit_memory = 2
    vm.overcommit_ratio = 90
    vm.nr_hugepages = 4096
    EOF
    sysctl --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).

    Terminal window
    dnf install -y tuned && tuned-adm active

    tuned 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.