r/linuxadmin • u/YGSnaffy • Jul 17 '26
Please teach me performance troubleshooting but in Linux
Windows is very tricky even with all resources around 0% usage, micro stutters and lag can still happen.
What is the general route to debugging a linux system for system admins or power users?
Thank you very much for your help!
19
Upvotes
14
u/st0ut717 Jul 17 '26
Top
13
u/Abe_Bazouie Jul 17 '26
My approach is usually to identify what the system is waiting on before trying to fix anything.
I normally check something like this:
If all of those look healthy, I'd start looking at the application itself, network latency, DNS, external dependencies, or database performance.
I'd also check Pressure Stall Information (PSI) (/proc/pressure/{cpu,memory,io}) on newer Linux kernels. It can reveal CPU, memory, or I/O pressure that isn't obvious from utilization metrics alone.
One mistake I see people make is jumping straight into random commands. Having a repeatable troubleshooting process is usually more valuable than memorizing dozens of Linux commands.
6
u/LostThirdValveSpring Jul 18 '26
Systems Performance 2nd Edition by Brendan Gregg. He also has a website. I’ve personally gone through this book and will say that not only does it have a ton of useful information, he’s also kind of THE person who’s come up with a lot of performance techniques/tools like Flame Graphs
8
u/kai_ekael Jul 17 '26
Step 1. Forget anything involved with Windoze.
4
u/J0hnnyGotAGun Jul 17 '26
tuned-adm
3
u/DigitalDefenestrator Jul 17 '26
For more detailed profiling, perf and async-profiler can be useful. Or atop for recording and replaying detailed system metrics.
2
u/BrokenWeeble Jul 17 '26
top and iostat to start with
2
u/vogelke Jul 17 '26
You can't tell if your system is sick until you get some idea of what it looks like when it's well.
Check things like disk use and memory availability every day and look for sudden changes.
If (say) memory use is always high, then you might have a misunderstanding about how it's actually used ("free memory is wasted memory") or your system might just be underpowered for what you're trying to do.
2
u/Wicaeed Jul 18 '26
htop/iftop/iotop + sudo gives you basically full system/process/io visibility on a system and that combined with strace + a process id and a good understand of how a linux process actually works and you'll uncover much.
2
u/Floss_Patrol_76 Jul 18 '26
the thing that made this click for me was picking a method instead of a pile of tools. brendan gregg's USE method is the one: for every resource (cpu, memory, disk, network) check Utilization, Saturation, and Errors, and let that tell you which tool to reach for. high load average with low cpu util points you at saturation, usually iowait, and then iostat/vmstat tell you which device instead of eyeballing top and guessing.
2
u/HTX-713 Jul 18 '26
Don't forget sar
1
u/jlrueda 13d ago
Use
clifr diffto compare two snapshots of your Linux server: one when performance was normal (FAST_TIME) and another when performance had degraded (SLOW_TIME).The objective is to identify what appeared, disappeared, or changed between the two moments. Like processes:
Compare network connections:
Compare system wide performance:
Compare disk performance:
clifr is a Linux System Flight Recorder (SFR) that continuously captures processes, connections, open files and system counters, then shows accurate ps, ss, lsof, top (and 30+ other) tools' full-output for any past moment; tamper-proof and with very low-overhead.
1
u/theactionjaxon Jul 17 '26
dstat is great itll break down utilization by disk ID
1
u/kensan22 Jul 17 '26
Epbf tracing, and also find a copy Brandon Greg's books on those topics (performances and ebpf)
1
u/mumpie Jul 17 '26
Take a look at: https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/performance_tuning_guide/chap-red_hat_enterprise_linux-performance_tuning_guide-performance_monitoring_tools
It's Redhat/Centos centric, but it gives a good summary of various CLI tools (some mentioned in other comments in the thread) and gives links to docs or guides for some of them.
1
u/jabies Jul 19 '26
top, iotop, hdparm, ps