How to Monitor CPU Temperature and Throttling on Linux Server
Step-by-step guide to monitor CPU temperature and throttling. Track CPU temperature, detect thermal throttling, and prevent performance degradation from overheating.
How to Monitor CPU Temperature and Throttling on Linux Server
Monitor CPU temperature and throttling to track thermal conditions, detect overheating, and prevent performance degradation. This guide shows you how to monitor CPU temperature and set up automated monitoring.
For comprehensive CPU monitoring, see CPU Monitoring. For troubleshooting CPU issues, see High CPU Usage.
Why Monitoring CPU Temperature Matters
High CPU temperature can cause thermal throttling, reducing CPU performance and potentially causing system instability. Monitoring CPU temperature helps prevent overheating and maintain optimal performance.
Method 1: Check CPU Temperature
Check Temperature with sensors
# Install sensors
sudo apt-get install lm-sensors # Debian/Ubuntu
sudo yum install lm_sensors # CentOS/RHEL
# Detect sensors
sudo sensors-detect
# Check CPU temperature
sensors
# Get CPU temperature only
sensors | grep "Core\|CPU\|Package"
Check Temperature from /sys
# Check CPU temperature (if available)
cat /sys/class/thermal/thermal_zone*/temp
# Convert to Celsius
for zone in /sys/class/thermal/thermal_zone*/temp; do
TEMP=$(cat $zone)
echo "$zone: $(($TEMP / 1000))°C"
done
Method 2: Check CPU Throttling
Monitor Thermal Throttling
# Check thermal throttling status
cat /proc/cpuinfo | grep -i "throttle"
# Check CPU frequency scaling
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
# Check CPU max frequency
cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_max_freq
Method 3: Automated Temperature Monitoring with Zuzia.app
Set up automated monitoring to track CPU temperature continuously and receive alerts when temperature exceeds thresholds or throttling occurs.
Step 1: Add Temperature Monitoring Command
-
Log in to Zuzia.app Dashboard
- Access your Zuzia.app account
- Navigate to your server
- Click "Add Scheduled Task"
-
Configure Temperature Check Command
sensors | grep "Core 0" | awk '{print $3}' | sed 's/+//' | sed 's/°C//'- Set execution frequency (every 5-10 minutes)
- Configure alerts when temperature exceeds thresholds
Step 2: Configure Alert Thresholds
- Warning: CPU temperature > 70°C
- Critical: CPU temperature > 80°C
- Emergency: CPU temperature > 90°C or throttling detected
Step 3: Monitor Throttling Status
Add command to check thermal throttling:
# Check for thermal throttling
dmesg | grep -i "thermal\|throttle" | tail -5
Best Practices for Temperature Monitoring
1. Monitor Temperature Continuously
- Track CPU temperature regularly
- Alert when temperature exceeds thresholds
- Monitor temperature trends over time
- Optimize cooling based on data
2. Monitor Thermal Throttling
- Track throttling events
- Alert on throttling detection
- Investigate root causes
- Optimize cooling and airflow
3. Set Appropriate Thresholds
- Set thresholds based on CPU specifications
- Adjust thresholds for different server types
- Monitor temperature during peak usage
- Alert on temperature spikes
4. Optimize Server Environment
- Ensure adequate cooling
- Optimize server airflow
- Monitor server room temperature
- Maintain server hardware
Troubleshooting Temperature Issues
Step 1: Identify Temperature Problems
When CPU temperature is high:
# Check current temperature
sensors
# Check thermal throttling
dmesg | grep -i "thermal\|throttle"
# Check CPU frequency
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
Step 2: Resolve Temperature Issues
Based on investigation:
-
Improve Cooling:
- Ensure adequate airflow
- Clean server fans
- Optimize server room temperature
-
Optimize CPU Usage:
- Reduce CPU load
- Optimize applications
- Scale infrastructure
-
Fix Hardware Issues:
- Replace faulty fans
- Fix cooling systems
- Update server hardware
FAQ: Common Questions About CPU Temperature Monitoring
How often should I check CPU temperature?
For production servers, continuous automated monitoring is essential. Zuzia.app can check CPU temperature every few minutes, storing historical data and alerting you when temperature exceeds thresholds.
What is considered high CPU temperature?
High CPU temperature depends on your CPU model. Generally, temperatures under 60°C are excellent, 60-70°C are good, 70-80°C are acceptable, and over 80°C require attention. Set thresholds based on your CPU specifications.
How do I prevent CPU overheating?
Prevent CPU overheating by ensuring adequate cooling, optimizing server airflow, monitoring server room temperature, reducing CPU load, and maintaining server hardware properly.
Can temperature monitoring impact server performance?
Temperature monitoring commands have minimal impact on server performance when done correctly. Use appropriate monitoring frequency and ensure monitoring doesn't interfere with server operations.
Related guides, recipes, and problems
-
Related guides
-
Related recipes
-
Related problems