使用:
当然了,有很多参数,请看最后面一一列举,现在来看看怎么用:
./orzdba -lazy -rt 2>/dev/null
注释:
count:此间隔内处理完成的请求数量
avg:此间隔内所有完成的请求,响应的平均时间
95_avg:此间隔内,95%的请求量的平均响应时间,单位微妙,该值较能体现MySQL Server的查询平均响应时间
注意:在mysql5.6版本之后,如果明文输出密码会有警告提示,造成输出异常,所以我们需要加上这个参数:2>/dev/null,来把它过滤掉.
监控InnoDB的各项指标:
./orzdba -innodb 2>/dev/null
监控MySQL Server性能:
./orzdba -mysql 2>/dev/null
还有几个稍微列举下,各位自己试试了
#查看Linux主机指标
./orzdba -sys -C 10 -i 1 -t -d sda
-sys:打印系统信息,包括-t(打印当前时间)、-l(打印负载信息,分1分钟、5分钟、15分钟)、-c(打印cpu信息)、-s(打印交换分区信息)
-d:打印磁盘信息,需要指点磁盘设备名
-n:打印网络信息,接收和发送大小,需要指点网卡设备名
查看DISK(-d)和NET(-n)需要带具体的设备名(具体可以查看/proc/diskstats和/proc/net/dev中的设备或者可以取自iostat
和sar -n DEV)
Linux指标的数据都来自/proc目录下的相关系统元数据:
LOAD : /proc/loadavg
CPU : /proc/stat
SWAP : /proc/vmstat
DISK : /proc/diskstats
NET : /proc/net/dev
#查看MySQL响应时间(rt)
./orzdba -rt -C 10 -i 1 -t -d sda
-C : 打印10次
-i : 间隔1秒
注释:
./orzdba --help
==========================================================================================
Info :
Created By [email protected]
Usage :
Command line options :
-h,--help Print Help Info.
-i,--interval Time(second) Interval.
-C,--count Times.
-t,--time Print The Current Time.
-nocolor Print NO Color.
-l,--load Print Load Info.
-c,--cpu Print Cpu Info.
-s,--swap Print Swap Info.
-d,--disk Print Disk Info.
-n,--net Print Net Info.
-P,--port Port number to use for mysql connection(default 3306).
-S,--socket Socket file to use for mysql connection.
-com Print MySQL Status(Com_select,Com_insert,Com_update,Com_delete).
-hit Print Innodb Hit%.
-innodb_rows Print Innodb Rows Status(Innodb_rows_inserted/updated/deleted/read).
-innodb_pages Print Innodb Buffer Pool Pages Status(Innodb_buffer_pool_pages_data/free/dirty/flushed)
-innodb_data Print Innodb Data Status(Innodb_data_reads/writes/read/written)
-innodb_log Print Innodb Log Status(Innodb_os_log_fsyncs/written)
-innodb_status Print Innodb Status from Command: ‘Show Engine Innodb Status‘
(history list/ log unflushed/uncheckpointed bytes/ read views/ queries inside/queued)
-T,--threads Print Threads Status(Threads_running,Threads_connected,Threads_created,Threads_cached).
-rt Print MySQL DB RT(us).
-B,--bytes Print Bytes received from/send to MySQL(Bytes_received,Bytes_sent).
-mysql Print MySQLInfo (include -t,-com,-hit,-T,-B).
-innodb Print InnodbInfo(include -t,-innodb_pages,-innodb_data,-innodb_log,-innodb_status)
-sys Print SysInfo (include -t,-l,-c,-s).
-lazy Print Info (include -t,-l,-c,-s,-com,-hit).
-L,--logfile Print to Logfile.
-logfile_by_day One day a logfile,the suffix of logfile is ‘yyyy-mm-dd‘;
and is valid with -L.
Sample :
shell> nohup ./orzdba -lazy -d sda -C 5 -i 2 -L /tmp/orzdba.log > /dev/null 2>&1 &
==========================================================================================