CPU Governor
The Linux CPU governor controls how quickly the CPU scales frequency under load. On some servers, power-saving profiles can keep the CPU at low frequencies until sustained load is detected, adding avoidable latency to short bursts of PHP work. For latency-sensitive WordPress workloads, using the performance governor can make response times more consistent.
If the governor is set to ondemand or powersave, the CPU may spend more time at lower frequencies and ramp up only after load is detected. Locking the server to performance keeps clocks high so short, bursty PHP requests are less likely to pay a ramp-up penalty.
Governor Profiles Explained
Linux automatically shifts between specific profiles depending on thermal and consumption logic. For high-throughput WordPress instances, these automated shifts are detrimental constraints.
| Profile Name | Operational Behavior | Target Environment |
|---|---|---|
performance | Horizontally locks the CPU frequency perfectly at absolute maximum capacity. | Mandatory for production WooCommerce and APIs. |
ondemand | Idles aggressively; ramps to maximum only after detecting heavy sustained load. | Restricted to local development test benches. |
schedutil | Integrated completely into the CPU scheduler; fluid and adaptive scaling boundaries. | Acceptable on generic application servers. |
powersave | Prioritizes lower frequency to reduce power use. | Not recommended for latency-sensitive WordPress workloads. |
Prerequisite Checks
- Server Control: Root CLI access over SSH to the Linux VPS/Bare Metal.
- Hardware Isolation: The operating system must operate via dedicated vCPUs. Cloud environments relying on shared/burstable CPU allocations (like AWS T4g nano or fractional DO Droplets) natively block governor manipulation via hypervisor restrictions.
- Tools Requirements: Functional installation of the
cpupowerutility sets.
Implementing Governor Parameters
Identify the Current Operating State
Poll the specific structural settings of the first CPU core dynamically:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Expected Default Output:
ondemand
List Available Governor Options
Interrogate the processor specifically to determine which governors the kernel natively supports:
cpupower frequency-info
System Response Example:
available cpufreq governors: ondemand performance powersave schedutil
Set the Governor to Performance
Immediately force the kernel to command the processor to execute entirely inside the maximum frequency envelope:
sudo cpupower frequency-set -g performance
Confirm the change utilizing the identical command from Step 1.
Guaranteeing Boot Permanence
Because the cpupower configuration clears upon rebooting the host node, the modification must be etched permanently into the Linux initialization sequence.
- systemd (Modern RHEL / Arch)
- cpufrequtils (Ubuntu / Debian)
Enable the primary cpupower daemon directly within the systemctl path.
sudo systemctl enable cpupower
sudo systemctl start cpupower
On heavy Debian distributions, inject the parameter variable directly into the core configuration layer structure.
# Construct the variable directly into the package default
echo 'GOVERNOR="performance"' | sudo tee /etc/default/cpufrequtils
# Enable the persistence daemon
sudo systemctl enable cpufrequtils
The Performance Impact Metrics
| Infrastructure Resource | Real-World Output Consequence |
|---|---|
| Raw Compute Capability | Avoids the 5ms-50ms ramp-up lag on short bursts of work. |
| Origin TTFB | Uncached WooCommerce checkout requests lock in immediately at minimum response thresholds. |
| Random Disks (NVMe) | Faster CPU instruction delivery rapidly increases the processing ceiling for database writes. |
| Energy Consumption | Wattage consumption skyrockets to maximum limits persistently (financially irrelevant in flat-rate VPS structures). |
Common Mistakes & Mitigation Strategy
| Failure Origin | Symptom Expression | Remediation Protocol |
|---|---|---|
| Governor resets after restart | Response time becomes less consistent after reboot. | Configure boot persistence (see "Guaranteeing Boot Permanence"). |
| Command ignored by the kernel | The configuration has no impact (or returns permission errors). | The hosting provider may block CPU frequency scaling in the hypervisor. Consider relocating to a host that allows it. |
| Missing Base Packages | Output: cpupower command not found. | Quickly apt install linux-tools-$(uname -r) or linux-cpupower to generate the binaries. |