User Tools

Site Tools


linux:debug

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:debug [2021/03/11 02:08]
tkilla created
linux:debug [2021/05/03 13:18] (current)
tkilla [High Load]
Line 1: Line 1:
 ====== Debug ====== ====== Debug ======
  
-Generic Tools to find root causes of problems+Check the logs
  
   dmesg -Hw   # Human readable, follow   dmesg -Hw   # Human readable, follow
   tail -f /var/log/syslog    tail -f /var/log/syslog 
   tail -f /var/log/syslog   tail -f /var/log/syslog
 +
 +
 +===== Out of Memory Problems =====
  
 Check RAM usage. Yes, it's always full, but space in "buff/cache" is free to use Check RAM usage. Yes, it's always full, but space in "buff/cache" is free to use
   free -m   free -m
  
-  +Show all Processes, sorted by virtual sizes (incl. shared libraries) 
 +  ps awwlx --sort=vsz
  
  
Line 27: Line 31:
  
  
-==== Tools to debug High Load ==== 
  
 === Check load === === Check load ===
Line 35: Line 38:
   top   top
      
-  Cpu(s): 11.4%us, 29.6%sy, 0.0%ni, 58.3%id, .7%wa, 0.0%hi, 0.0%si, 0.0%st+  sar -u 5 
 + 
 + 
 +Results: Cpu(s): 11.4%us, 29.6%sy, 0.0%ni, 58.3%id, .7%wa, 0.0%hi, 0.0%si, 0.0%st
  
 IF "wa" I/O wait is high, the load is most probably Disc bound (or RAM)  IF "wa" I/O wait is high, the load is most probably Disc bound (or RAM) 
 +
 +IF "sy" System is high, it might be, **mdadm rund a RAID check**
  
  
Line 52: Line 60:
   ps -e v   ps -e v
  
-This outputs the state of each process. Specially D is intereting (but also R): 
  
-D    Marks a process in disk (or other short term, uninterruptible) wait. +Check which processes are in R or D state: 
-R    Marks a runnable process + 
-...+  ps -eo s,user,cmd | grep ^[RD] | sort | uniq -c | sort -nbr | head -20 
 + 
 + 
 +This outputs the state of each process. Specially D is interesting (but also R): 
 + 
 +  * D    Marks a process in disk (or other short term, uninterruptible) wait. 
 +  R    Marks a runnable process 
 + 
 + 
 +PSN - Linux Process Snapper is another nice tool: 
 + 
 +Install from: https://tanelpoder.com/psnapper/ 
  
 === Links === === Links ===
  
   * https://www.linuxjournal.com/article/10688   * https://www.linuxjournal.com/article/10688
-  * +  * https://www.tummy.com/articles/isolating-heavy-load/ 
 +  * https://tanelpoder.com/posts/high-system-load-low-cpu-utilization-on-linux/
  
linux/debug.1615424925.txt.gz · Last modified: 2021/03/11 02:08 by tkilla