ps axu命令详解
$ ps aux |grep mysql
root 2542 0.0 0.0 1872 544 ? S 09:00 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 2605 2.5 2.0 177872 61200 ? Sl 09:00 9:58 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
root 7740 0.0 0.0 1876 552 ? S 10:52 0:00 /bin/sh /opt/redmine-1.1.1-0/mysql/bin/mysqld_safe --defaults-file=/opt/redmine-1.1.1-0/mysql/my.cnf --port=3308 --socket=/opt/redmine-1.1.1-0/mysql/tmp/mysql.sock --old-passwords --datadir=/opt/redmine-1.1.1-0/mysql/data --log-error=/opt/redmine-1.1.1-0/mysql/data/mysqld.log --pid-file=/opt/redmine-1.1.1-0/mysql/data/wutai.pid --lower-case-table-names=1 --default-table-type=InnoDB
mysql 7857 0.0 0.5 111880 16616 ? Sl 10:52 0:04 /opt/redmine-1.1.1-0/mysql/bin/mysqld.bin --defaults-file=/opt/redmine-1.1.1-0/mysql/my.cnf --basedir=/opt/redmine-1.1.1-0/mysql --datadir=/opt/redmine-1.1.1-0/mysql/data --user=mysql --old-passwords --lower-case-table-names=1 --default-table-type=InnoDB --log-error=/opt/redmine-1.1.1-0/mysql/data/mysqld.log --pid-file=/opt/redmine-1.1.1-0/mysql/data/wutai.pid --socket=/opt/redmine-1.1.1-0/mysql/tmp/mysql.sock --port=3308
tommy 17488 0.0 0.0 6480 2516 pts/1 S+ 15:27 0:00 mysql -uroot -px xxx
tommy 17684 0.0 0.0 3336 792 pts/3 R+ 15:30 0:00 grep mysql
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
STAT中参数意义
D 不可中断
R 正在运行
S 处于休眠
T 停止or被追踪
Z 僵尸进程
W 进入内存交换
X 死掉的进程
rss 进程使用的总物理内存数
ps -eo user,pid,stat,rss,args -sort rss