Boost MySQL Performance: Essential Linux and Hardware Tuning Tips
This guide explains how to improve MySQL server performance by applying BIOS tweaks, CPU and memory profile settings, disabling NUMA, choosing the right RAID level and cache options, selecting optimal filesystems and I/O schedulers, and adjusting Linux kernel parameters for maximum efficiency.
BIOS Settings
Set the Thermal Base Algorithm to Maximum Performance to keep the processor and memory cool under load, and increase fan speed if needed.
Adjust Fan Speed Offset to High Fan speed offset so fans run near full speed (≈90‑100%) when high‑power PCIe cards are installed.
System Profile Settings
CPU: choose Maximum Performance to allow full power usage.
Memory Frequency: set to Maximum Performance .
C1E: disable to prevent the CPU from entering the lowest‑power idle state.
C States: disable all C‑states to keep the CPU at full performance.
CPU C‑State Details
The Dell R730 uses Intel Xeon E5 v3 (Haswell) CPUs with ten C‑states, but C7‑C10 are for mobile devices and are not used on servers.
C0 : active state, normal operation.
C1/C1E : idle state entered via HLT; C1E can lower voltage and frequency, saving up to 70% power with a 10 ns wake‑up time.
C2/C2E : deeper idle, stops clock and I/O buffers, also saves ~70% power; wake‑up >100 ns.
C3 : deep sleep, locks bus frequency, saves ~70% power, wake‑up ~50 µs.
C4/C4E : even deeper sleep, L2 cache reduced, saves up to 98% power, wake‑up ≤1 s.
C6 : deepest sleep, clears L1 cache, very low voltage, longest wake‑up.
NUMA
Disable NUMA to avoid uneven memory allocation that can cause swapping and slow the database. If the BIOS option is missed, add numa=off to the kernel line in /etc/grub.
Tests show a 33% performance increase after disabling NUMA.
RAID Configuration
Prefer RAID10 ; if unavailable, use RAID5 .
Turn off physical disk cache to prevent data loss.
Use high‑speed disks (15 kRPM) or SSD/PCIe‑SSD when possible.
For OLTP workloads, RAID10 offers better write performance; for large file storage or data warehouses, RAID5 provides better space efficiency.
RAID10 needs only 2 I/O operations per write, while RAID5 may need up to 4, affecting IOPS.
RAID Cache & BBU
Set write policy to Write Back (WB) and disable read‑ahead.
Enable Force WB with no battery if a battery is not present.
Disable the disk’s own cache.
Commands (Dell example):
MegaCli64 -LDSetProp NORA -LALL -aALL MegaCli64 -LDSetProp CachedBadBBU -lall -a0 MegaCli64 -LDSetProp -DisDskCache -Lall -aALLWhen the BBU fails, the controller falls back to Write Through, reducing write performance but keeping data safe.
Capacitors can replace batteries, offering longer life and instant protection without the 4‑9 hour recharge delay.
Filesystem and I/O Scheduler
Use XFS (default on RHEL 7) for better overall performance compared to EXT4.
Choose the deadline scheduler; for SSDs, noop is also acceptable.
Check current scheduler: cat /sys/block/sda/queue/scheduler Change temporarily: echo deadline > /sys/block/sda/queue/scheduler Make permanent by adding elevator=deadline to the kernel line in /etc/grub.conf.
Operating System Tweaks
Mount the data partition with noatime and nobarrier options (e.g.,
/dev/sda4 on /data0 type xfs (rw,noatime,nobarrier,logbufs=8)).
Set vm.swappiness=0 in /etc/sysctl.conf and apply with sysctl -p to prefer RAM over swap.
noatime stops recording file access timestamps, reducing unnecessary writes and improving I/O throughput.
nobarrier disables write barriers that enforce journal ordering; it should only be used when the storage has reliable battery‑backed or flash‑backed write cache, otherwise data consistency after crashes may be compromised.
Conclusion
Optimizing the operating system and server hardware—BIOS settings, CPU power profiles, disabling NUMA, proper RAID selection, cache configuration, filesystem choice, I/O scheduler, and kernel parameters—significantly improves MySQL server performance and should be incorporated into deployment standards.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
dbaplus Community
Enterprise-level professional community for Database, BigData, and AIOps. Daily original articles, weekly online tech talks, monthly offline salons, and quarterly XCOPS&DAMS conferences—delivered by industry experts.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
