CPU, Memory Usage by Apache

APACHE PROCESSES THAT CPU OR MEMORY IS LARGER THAN 0

ps -A --sort -rss -o pid,comm,pmem,pcpu,lstart | grep httpd | awk '($3>0) || ($4>0)'

TOTAL CPU USED BY THE APACHE PROCESS

ps -A --sort -rss -o pid,comm,pmem,pcpu | grep httpd | awk '{n+=$4} END {print n"%"}'

TOTAL MEMORY USED BY THE APACHE PROCESS

ps -A --sort -rss -o pid,comm,pmem,pcpu | grep httpd | awk '{n+=$3} END {print n"%"}

You can use server-status module to monitoring apache

lynx http://localhost/server-status?refresh=5
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s