krkr
5/11/2017 - 12:16 PM

Basic perfs checks

Basic perfs checks

# top 5 CPU processes
ps -eo pcpu,comm= --sort=-pcpu | head -n 5

# top 5 MEM processes
ps -eo pmem,comm= --sort=-pmem | head -n 5

# sort tcp open connections
echo "TCP ACTIVE CONN"
netstat -ant | tail -n +3 | awk '{print $6}' | sort | uniq -c | sed -e 's/^\s*/ /' | sort -rn

# show established
ss state established | awk '{print $5}' | sort | uniq -c | sort -nr | head