2. ๐ง Linux Troubleshooting & Performance Tuning for DevOps Engineers
Open to Work | Cloud & DevOps Engineer | AWS | Kubernetes | Terraform | CI/CD | Automations | Available for Full-Time / Freelance / Mentorship
๐ฏ Why This Blog Matters?
In real DevOps roles, you are rarely asked โwhat is Linux?โ
Instead, you are asked:
โCPU is 100%, disk is full, application is slow โ what will you do?โ
This blog covers exactly those real-world scenarios.
๐ฅ Common Linux Performance Issues
High CPU usage
Memory leaks
Disk space exhaustion
High load average
Slow application response
Zombie or stuck processes
๐น Troubleshooting High CPU Usage
Step 1: Identify the Process
top
htop
Look for:
%CPU
Load average
Process state
Step 2: Analyze the Process
ps -eo pid,ppid,cmd,%cpu,%mem --sort=-%cpu | head
Step 3: Inspect Threads
top -H -p <PID>
Step 4: Take Action
kill -9 <PID>
renice +10 <PID>
๐น Troubleshooting High Memory Usage
Check Memory Stats
free -m
vmstat 1 5
Identify Memory-Hungry Processes
ps aux --sort=-%mem | head
Check for Memory Leaks
Java โ Heap dump
Python โ Infinite object creation
Containers โ Missing memory limits
๐น Understanding Load Average (Interview Favorite)
uptime
Load Average = Number of processes waiting for CPU.
| CPU Cores | Load | Status |
| 4 | 2 | Healthy |
| 4 | 4 | Full |
| 4 | 8 | Overloaded |
๐น Disk Space Troubleshooting
Step 1: Check Disk Usage
df -h
Step 2: Find Large Directories
du -sh /* | sort -h
Step 3: Find Large Files
find / -type f -size +1G 2>/dev/null
Step 4: Clean Safely
logrotate
journalctl --vacuum-time=7d
โ ๏ธ Never delete logs blindly.
๐น Disk I/O Bottlenecks
iostat -x 1
High:
%util
await
๐ Indicates disk latency issues.
๐น Zombie & Stuck Processes
ps aux | grep Z
Zombie = Process finished but not reaped by parent.
Fix:
Restart parent process
Restart service
๐น Network Slowness Troubleshooting
ss -tulnp
netstat -i
ping
traceroute
Check:
Packet drops
Port conflicts
Network latency
๐น Service-Level Troubleshooting
systemctl status nginx
journalctl -u nginx
Restart safely:
systemctl restart nginx
๐น CPU, Memory & Disk Tuning Tips
CPU
Reduce thread count
Enable autoscaling
Tune application configs
Memory
Add swap (temporary fix)
Configure heap limits
Use memory limits in Docker
Disk
Separate volumes
Enable log rotation
Monitor inode usage
๐น Real Production Scenario
Issue: Kubernetes node showing
NotReady
Root Cause:
- Disk full due to container logs
Fix:
df -h
du -sh /var/lib/docker/*
Enable:
log rotation
disk monitoring alerts
๐ฏ Interview Takeaways
Always start with observability
Never kill blindly
Fix root cause, not symptoms
Linux troubleshooting = calm + systematic