#查看占用内存最多的进程,前五名[root@09-01 test]# ps -aux | sort -k4nr | head -5Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQmysql 27023 0.7 18.6 5174468 1504520 ? Sl Oct19 152:41 /usr/sbin/mysqld --defaults-file=/data/mysql/3306/my.cnf --basedir=/usr --datadir=/data/mysql/3306/data --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/data/mysql/3306/mysql_error.log --open-files-limit=3000 --pid-file=/data/mysql/3306/mysql3306.pid --socket=/tmp/mysql3306.sock --port=3306www 22208 0.3 0.7 506424 58756 ? S 12:24 0:29 php-fpm: pool wwwwww 22209 0.3 0.7 506036 58472 ? S 12:24 0:36 php-fpm: pool wwwwww 22210 0.2 0.7 505404 60256 ? S 12:24 0:29 php-fpm: pool wwwwww 22212 0.3 0.7 508276 62628 ? S 12:24 0:33 php-fpm: pool www#查看进程占用cpu最多的进程[root@09-01 test]# ps -aux | sort -k3nr | head -5Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQroot 25549 99.2 0.0 15292 1464 ? R Oct10 34449:32 topmysql 27023 0.7 18.6 5174468 1504520 ? Sl Oct19 152:44 /usr/sbin/mysqld --defaults-file=/data/mysql/3306/my.cnf --basedir=/usr --datadir=/data/mysql/3306/data --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/data/mysql/3306/mysql_error.log --open-files-limit=3000 --pid-file=/data/mysql/3306/mysql3306.pid --socket=/tmp/mysql3306.sock --port=3306www 22209 0.3 0.7 506036 58480 ? S 12:24 0:36 php-fpm: pool wwwwww 22212 0.3 0.7 508276 62628 ? S 12:24 0:33 php-fpm: pool wwwwww 22224 0.3 0.6 508036 56228 ? S 12:24 0:30 php-fpm: pool www#TCP状态(连接状态数量统计):[root@166087 data]# netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'ESTABLISHED 7TIME_WAIT 2#分析访问日志哪个URL访问最多,排序显示cat access.log | awk '{print $7}' | grep -v 'images\|js\|upload\|/$\|css' | sort -nr | uniq -c | sort -nr | more分析访问日志查看哪个IP访问次数最多cat net_access.log | awk '{print $1}' | sort -nr | uniq -c | sort -nr | more