Raspberry Pi Overclocking Guide
Safely overclock your Raspberry Pi 4 or 5 for better performance. Covers config.txt settings, cooling, and stability testing.
Introduction
Overclocking can boost performance by 15–30% on Raspberry Pi 4 and 5, useful for running heavier workloads. This guide covers safe settings, cooling requirements, stability testing, and when to skip overclocking entirely.
Prerequisites
- Raspberry Pi 4 or Pi 5
- Adequate cooling (heatsink minimum, fan recommended)
- SSH access or terminal
stress-ngfor stability testing- Backup of current
/boot/config.txt
Step 1 — Backup and Prepare
Always back up before modifying boot config:
sudo cp /boot/firmware/config.txt /boot/firmware/config.txt.backup
On older Raspbian (before May 2023), the path is /boot/config.txt. Check your Pi's boot location:
ls -la /boot/
Step 2 — Overclock Settings by Model
Edit the config file:
sudo nano /boot/firmware/config.txt
Add or modify these lines at the end:
Raspberry Pi 4 (Conservative, Daily Use)
[pi4]
arm_freq=1950
arm_voltage=4
gpu_freq=600
over_voltage=2
force_turbo=0
Raspberry Pi 4 (Aggressive, Heavy Workload)
[pi4]
arm_freq=2000
arm_voltage=6
gpu_freq=650
over_voltage=4
force_turbo=1
Raspberry Pi 5 (Safe, No Derating)
[pi5]
arm_freq=3000
gpu_freq=910
over_voltage=0
The Pi 5's new firmware handles thermal throttling gracefully—it won't crash. Even with arm_freq=3000, voltage stays stable at stock.
Settings Reference
| Parameter | Effect | Safe Range |
|---|---|---|
arm_freq |
CPU frequency (MHz) | Pi 4: 1800–2100; Pi 5: 2800–3200 |
gpu_freq |
GPU frequency (MHz) | Pi 4: 500–700; Pi 5: 850–1000 |
over_voltage |
Increase voltage (steps of 0.025V) | Pi 4: 0–6; Pi 5: 0–2 |
arm_voltage |
Set CPU voltage directly | Pi 4: 1.2–1.3V (recorded as 0–8 offset) |
force_turbo |
Always run at max frequency | 0 (adaptive) or 1 (always on) |
Higher over_voltage cuts lifespan. Limit to 2–4 on Pi 4 for longevity.
Step 3 — Set Up Cooling
Overclocking without cooling throttles immediately. Upgrade your thermal management:
Passive (Heatsink only)
- Cost: $5–15
- Performance: 5–10°C drop
- Best for: Pi running at stock or mild 1950 MHz
Active (Small fan + heatsink)
- Cost: $15–30
- Performance: 15–25°C drop
- Best for: Daily overclocking to 1950–2000 MHz
High-end (Ice Tower or equivalent)
- Cost: $40–70
- Performance: 25–35°C drop
- Best for: 2000+ MHz, sustained loads
Install a heatsink with thermal pads—no thermal paste needed. Verify contact with vcgencmd measure_temp before and after overclocking.
Step 4 — Stability Testing
After setting overclock, stress-test for 30+ minutes:
# Install stress-ng
sudo apt install stress-ng -y
# Run CPU stress test for 30 minutes
stress-ng --cpu 4 --timeout 30m --metrics-brief
# During test, monitor temperature in another terminal
watch -n 1 'vcgencmd measure_temp'
Good result: Sustained performance, temp stays <80°C, no crashes.
Bad result: Throttling kicks in (freq drops), crashes, or thermal shutdown. Revert to previous settings or add cooling.
Check for errors:
# See system messages
dmesg | tail -20
Look for CPU voltage warnings or thermal_cstate messages—these indicate instability.
Step 5 — Benchmark Before and After
Measure real-world impact with Sysbench:
# Install sysbench
sudo apt install sysbench -y
# Single-thread CPU benchmark (no overclock baseline first)
sysbench cpu --cpu-total-threads=1 run
# Multi-thread
sysbench cpu --cpu-total-threads=4 run
Typical results (Pi 4, stock vs overclocked 2000 MHz):
- Single-thread: 1200 → 1500 events/sec (+25%)
- Multi-thread: 4000 → 5500 events/sec (+37%)
Warranty and When NOT to Overclock
Voids warranty? Overvolting does. Check your Pi's fuse:
vcgencmd read_register 0x3d5812d0
If it returns a non-zero value, you've triggered the overvolt fuse and voided the warranty. Stock frequency changes alone don't trigger it.
Skip overclocking if:
- Running at 80+ °C already without overclock
- Using Pi in a sealed enclosure
- Deployed remotely and can't monitor it
- Running 24/7 on battery—extra power draw drains it faster
Troubleshooting
Pi won't boot after overclock This is why you backed up config.txt. Boot into recovery:
sudo cp /boot/firmware/config.txt.backup /boot/firmware/config.txt
sudo reboot
Temperature stuck high (>85°C) Your cooler isn't making contact. Remove and reapply thermal pad, ensuring heatsink sits flush. Test with heatsink only (no fan) to isolate the issue.
Crashes under load, stable at rest
Reduce arm_freq or over_voltage by one notch. Pi 4 is usually stable at 1950 MHz with voltage 2–4; pushing to 2000 MHz requires voltage 4–6.
Thermal throttling kicks in mid-test
GPU is competing for cooling. Reduce gpu_freq or improve air flow. Pi 5 handles this better with dynamic thermal management.
Summary
Conservative overclocking (Pi 4 to 1950 MHz, Pi 5 to 3000 MHz) with passive cooling adds noticeable performance for demanding workloads. Test thoroughly and monitor temps—the 20–30% speed gain isn't worth a dead Pi. For production deployments, keep stock settings and invest in better code optimization instead.