Saturday, January 27, 2024

Linux Performance trouble shooting

Linux Performance trouble shooting

Load Avg 1 min 5 min 15 min

CPU Script to hog the CPU

cpuhog.sh

while true
do yes > /dev/null
done

Disk hog io hog
dd if = /dev/sda of=dev/zero

%us : user space utlizttion started by user/application
%sy : system spce Kernel side utlization
%ni : nice -20 highest 90 is lowesr
%id : idle amount of time CPU is not doing anything
%si : time waiting for the CPU for the IO
%hi : Hardware inturupt
%si : Software inturrupt
%st : Referect stleth used for Virtual System
Cat /proc/interrupt

Load avg ( we will get the info from the following location)

cat /proc/lodavg

cat /proc/slabinfo | grep -i den

cat /proc/meminfo | grep -i slab (Kernel Memory usge )

Buffer consits of metatdata

cat /proc/slabinfo | grep -i den

How to check the dentry size

slabtop | grep -i den

Command to find the kernel Memory

cat /proc/meminfo | grep -i slab (Kernel Memory usge )
Cache app =====> ram (cache) ====> disk
CPU L1/L2/L3 cache =====> Cache====> disk

Command to check the L1 and L2 cache


Shared memory shared by diffrent process

pmap -i

command to free the cache memory (never run the same in the prod box)

sync && echo 3 > /proc/sys/vm/drop_caches (never run the same in the prod box)

to Free page cache dentries and inodes
echo 3

to free dentires and inodes

echo 2
to free page cache
ehco 1
lscpu | grep L1.l2 cache

command to find the which CPU is using for which processor
ps -eo pid,arfs,psr

Command to find the how many CPU are present

cat /proc/cpuinfo | grep -i processor


No comments:

Post a Comment