Process list with threads with PS
ps axH -o psr,%cpu,pgrp,cmd
list top 20 connection
cut -d " " -f 10 /proc/net/ip_conntrack |sort |uniq -c |sort -nr|head -n20
Source is the iptables conntrack (ip_conntrack module must be loaded! )
using cat, sort, uniq, proc fs
or for the top 20 port 80 Connections....
grep "dport=80" /proc/net/ip_conntrack | awk '{ print $5 " " $6 }' |grep "dst=129.132.95.202"|cut -d " " -f1| cut -d "=" -f2|sort|uniq -c|sort -nr|head -20
find the most swapping process
for file in /proc/*/status ; do awk '/VmSwap|Name|Pid/{printf $1 " " $2 " " $3 " " $4}END{ print ""}' $file; done|sort -k10 -n -r |head -n20