Capacity Planning

De Wiki Hackstore

Software

Liste os processos ordenando pelo maior consumo de memória ram

ps -eo pmem,pcpu,rss,vsize,args | sort -k 1 -r | less


Meça o consumo individual de algum processo

pgrep apache2 | xargs -n1 -I{} cat /proc/{}/smaps |   awk '{if ($0 ~ /stack/) {pids+=1} else if ($0 ~/^Shared_/) {shared+=$2} else if ($0 ~ /^Pss:/) {priv+=$2}} END {printf "%.2f MB\n",(priv+shared/(pids*pids))/1024}'


Exibir espaço em disco ocupado por cada ebuild (Funtoo/Gentoo)

equery s $(eix -s|egrep '\[I'|cut -d" " -f2) > lista
awk '{print $4, $1}' lista |sed  s,'size(',,g|sed s,')',,g |sort|uniq|sort -n > lista2
cat lista2 |awk '{print $2, $1/=1048576;printf "%.2fMB\n",$1}'



Hardware

Slots PCI ou PCI-Express livres

dmidecode -t 9 | grep -E "DMI type"\|Usage\|Type
http://techblog.netflix.com/2015/11/linux-performance-analysis-in-60s.html
http://techblog.netflix.com/2015/08/netflix-at-velocity-2015-linux.html