High Performance Mysql commands

p90

show global status;

 mysqladmin ext -i1 -uroot -p | awk '/Queries/{q=$4-qp;qp=$4} /Threads_connected/{tc=$4} /Threads_running/ {printf "%5d  %5d  %5d\n", q,tc,$4}'


586862     53     36
 4167     53     43
 4305     53     36
 4832     53     14
 4462     53     25
 4730     53     24
 4658     53     51
 4228     53      7
 4586     53      7
 4002     53     41
 

show processlist\G

mysql -e "show processlist\G" | grep State: | sort | uniq -c | sort -rn 

Information_schema can also query the table or innotop tool processlist

The slow query log

slow_query_log=on;

long_query_time=1;

slow_query_log_file=/mysql/slow/slow.log

log_queries_not_using_indexes=on;

 

::: reiterated in a good tool to help diagnose such problems, or to manually query log in a few hundred G's how to find out why worry about a thing.

Statistical queries per second:

awk '/^# Time:/{print $3,$4,c;c=0} /^# User/{c++}' slow-query.log

 

 

 

 

Guess you like

Origin blog.csdn.net/pang_2899/article/details/93587078