ps -ylC httpd | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'
acquired from:
http://webserverpage.com/how-to-measure-or-calculate-maximum-memory-usage-of-apache/
#!/bin/bash
if [ $# -ne 1 ]
then
echo ""
echo "ERROR: pass in process name"
echo " $0 {httpd|java}"
echo ""
exit 9
fi
echo "* * * * * * * *"
uname -n
ps -ylC ${1} | awk '{x += $8;y += 1} END {print "'${1}' Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'
echo ""
exit 0
morpheus:~ jradtke$ for HOST in 2 3 4 5; do ssh fatapp0${HOST} "uname -n; for PROC in httpd java; do /opt/bin/check_process_memory.sh \${PROC}; done"; echo; done
acquired from:
http://webserverpage.com/how-to-measure-or-calculate-maximum-memory-usage-of-apache/
#!/bin/bash
if [ $# -ne 1 ]
then
echo ""
echo "ERROR: pass in process name"
echo " $0 {httpd|java}"
echo ""
exit 9
fi
echo "* * * * * * * *"
uname -n
ps -ylC ${1} | awk '{x += $8;y += 1} END {print "'${1}' Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'
echo ""
exit 0
morpheus:~ jradtke$ for HOST in 2 3 4 5; do ssh fatapp0${HOST} "uname -n; for PROC in httpd java; do /opt/bin/check_process_memory.sh \${PROC}; done"; echo; done
Comments
Post a Comment