Linux kernel tuning for oracle database

Linux kernel tuning for oracle database

Linux kernel tuning is one of the most important layers for Oracle database performance, especially for OLTP systems, RAC, and high-concurrency workloads. A properly tuned kernel reduces memory contention, improves I/O throughput, and stabilizes latency.

Below is a production-grade Linux kernel tuning guide for Oracle (RHEL / Oracle Linux).


1. Why kernel tuning matters for Oracle

Oracle performance depends heavily on:

  • Memory handling (SGA/PGA)
  • File system limits
  • I/O scheduling
  • Network stack efficiency
  • Process/thread limits

👉 If kernel is misconfigured, even NVMe + powerful CPUs will underperform.


2. Core kernel configuration file

Main file:

/etc/sysctl.conf

Apply changes:

sysctl -p

3. Memory tuning (most critical)

🔹 1. Shared memory limits (SGA support)

Key parameters:

  • kernel.shmmax
  • kernel.shmall
  • kernel.shmmni

👉 Ensures Oracle SGA fits in memory without fragmentation.


🔹 2. Virtual memory tuning

Key parameters:

  • vm.swappiness
  • vm.dirty_ratio
  • vm.dirty_background_ratio

Best practice:

  • Reduce swap usage aggressively
  • Control write-back behavior

👉 Goal: avoid memory paging (huge performance killer)


🔹 3. Disable Transparent HugePages (THP)

THP causes:

  • Latency spikes
  • Unpredictable memory allocation

Best practice:

  • Disable THP
  • Use static HugePages

🔹 4. HugePages (very important)

Benefits:

  • Faster SGA access
  • Lower CPU overhead
  • No memory fragmentation

👉 Rule:
Allocate HugePages ≈ total SGA size


4. File system and I/O tuning

🔹 1. File descriptor limits

Parameters:

  • fs.file-max
  • fs.aio-max-nr

👉 Prevents “too many open files” errors under load


🔹 2. I/O scheduler tuning

For SSD/NVMe systems:

  • none (best for NVMe)
  • mq-deadline (balanced)

Avoid:

  • cfq (legacy, slow for Oracle workloads)

🔹 3. Async I/O support

Enable:

  • fs.aio-max-nr
  • Oracle async I/O usage

👉 Improves parallel disk operations


5. Network tuning (important for RAC & apps)

🔹 1. TCP buffer tuning

Parameters:

  • net.core.rmem_max
  • net.core.wmem_max
  • net.ipv4.tcp_rmem
  • net.ipv4.tcp_wmem

👉 Improves throughput for high-volume DB traffic


🔹 2. Connection backlog tuning

  • net.core.somaxconn
  • net.ipv4.tcp_max_syn_backlog

👉 Prevents connection drops under heavy load


🔹 3. Reduce network latency

  • Disable unnecessary TCP features if needed (TSO/GRO tuning depending on NIC)
  • Use high-speed NICs (25G/100G for RAC)

6. Process and CPU tuning

🔹 1. Process limits

  • kernel.pid_max
  • fs.nr_open

👉 Supports high session concurrency


🔹 2. Thread scheduling

  • Ensure fair CPU scheduling
  • Avoid CPU starvation

🔹 3. NUMA awareness (critical on modern servers)

On multi-socket systems:

  • Align Oracle processes to NUMA nodes
  • Avoid cross-socket memory access

👉 Reduces latency significantly


7. Kernel tuning for Oracle RAC

If using RAC:

  • Optimize interconnect traffic
  • Increase network buffer sizes
  • Reduce kernel-level latency

Key focus:

  • Low jitter networking
  • High throughput interconnect

8. Example production sysctl settings (typical baseline)

# Memory
kernel.shmmax = 68719476736
kernel.shmall = 4294967296

vm.swappiness = 10
vm.dirty_ratio = 15
vm.dirty_background_ratio = 5

# File handles
fs.file-max = 6815744
fs.aio-max-nr = 1048576

# Network
net.core.rmem_max = 134217728
net.core.wmem_max = 134217728
net.ipv4.tcp_rmem = 4096 87380 134217728
net.ipv4.tcp_wmem = 4096 65536 134217728

net.core.somaxconn = 65535
net.ipv4.tcp_max_syn_backlog = 65535

9. Oracle-side kernel dependency tuning

Kernel tuning must align with Oracle parameters:

🔹 SGA alignment

  • Must fit within HugePages

🔹 PGA tuning

  • Avoid excessive swap usage

🔹 I/O configuration

  • Async I/O enabled

10. Common kernel-related Oracle performance issues

🔴 Memory swapping

  • Causes severe latency spikes

🔴 High I/O wait

  • Poor scheduler or storage config

🔴 File descriptor exhaustion

  • Leads to session failures

🔴 Network congestion

  • Affects RAC or app connectivity

🔴 CPU starvation

  • Improper scheduling or overcommit

11. Enterprise tuning methodology

✔ Step 1: Baseline capture

  • AWR reports
  • OS metrics (vmstat, iostat, sar)

✔ Step 2: Memory tuning

  • HugePages setup
  • Disable THP

✔ Step 3: I/O tuning

  • Scheduler selection
  • Async I/O enablement

✔ Step 4: Network tuning

  • TCP buffer optimization
  • Reduce latency

✔ Step 5: CPU + NUMA tuning

  • Process binding
  • Node alignment

✔ Step 6: Continuous monitoring

  • AWR + OS metrics correlation

12. Best practices summary

✔ Disable Transparent HugePages
✔ Enable HugePages for SGA
✔ Set low swappiness (avoid swap)
✔ Tune file descriptors aggressively
✔ Use NVMe-friendly I/O scheduler (none)
✔ Optimize TCP buffers for high throughput
✔ Align workloads with NUMA nodes
✔ Enable async I/O for Oracle
✔ Monitor kernel + Oracle metrics together


Final takeaway

Linux kernel tuning is the foundation layer of Oracle performance. If the kernel is not tuned correctly, no amount of CPU, memory, or storage upgrades will deliver expected performance.

Looking for servers Rental ?

Call Our Expert :


  • (call for rental enquiries)

Email us :