Linux commands average memory usage


For apache2 (httpd) on debian sqeeze, but should work on almost any dist as long awk is installed

$ ps aux | grep 'apache2' | awk '{print $6/1024;}' | awk '{avg += ($1 - avg) / NR;} END {print avg " MB";}'

and for mysql

$ ps aux | grep 'mysqld' | awk '{print $6/1024;}' | awk '{avg += ($1 - avg) / NR;} END {print avg " MB";}'
Share

ELExGspot | elexgpunkt@html5live.at

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

*