Scratch pad

From SPOT CHECK IT
Revision as of 01:01, 12 April 2022 by Admin (talk | contribs)
Jump to: navigation, search

This page is to keep items I will organize on the page later or ideas.

Analyse and calculate php-fpm runner settings https://megamorf.gitlab.io/2021/03/08/analyse-and-calculate-php-fpm-runner-settings/


Get average memory of the php-fpm process

ps --no-headers -o "rss,cmd" -C php-fpm | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'


Get memory of all php-fpm processes

ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | grep php-fpm


How many cores does server have.

echo Cores = $(( $(lscpu | awk '/^Socket/{ print $2 }') * $(lscpu | awk '/^Core/{ print $4 }') ))