This article mainly introduces the relevant information of mysql innodb monitoring (system layer, database layer). Friends in need can refer to
mysql innodb monitoring ( System layer, database layer)
Regarding MySQL monitoring, mysql provides data collection commands, such as the show status command or the GLOBAL_STATUS object that reads the database informat_schema; you can also use some ready-made monitoring tools. For queries, innotop, mysqlreport, mtop, mytop, and orzdba developed by Taobao perl language are currently used more frequently.
As far as monitoring indicators are concerned, there are system level and database level.
1. The system level includes the system load, cpu, whether the memory has swap, disk IO, and network.
vmstat -w 1 iostat -x -k 1 sar -n DEV 1
2, mysql databaselayer
show global status where Variable_name in('xxxx')或者show global status like 'xxx%'
The data collected is generally the total quantity that has been collected so far. If you want to calculate The number per second can be calculated like this, taking TPS as an example.
# 1) Sql statement execution times QPS------(Com_select, Com_insert, Com_update, Com_delete)
2) Transaction TPS----(Com_commit, Com_rollback) 3) Row status (number of rows modified and deleted per second)-----(Innodb_rows_inserted, Innodb_rows_updated, Innodb_rows_deleted, Innodb_rows_read)
4) Page status (total pages in the buffer pool) Number, free, dirty, number of flushed pages per second) ---- (Innodb_buffer_pool_pages_flushed
5) Query cache Hit (query cache hit rate)-----(inno_buffer_pool_read_requests
6 )Data status (number of data reads and writes per second in the memory buffer, read and write size per second M)----(Innodb_data_reads
7) Log (log_fsync number of times the log is synced to disk per second, log size written per second M) ---- -(Innodb_os_log_fsyncs
8) Thread status (number of threads created per second) ----- - (Threads_running
. The amount of data received or sent from the client M---(Bytes_received, Bytes_sent)
The above is the detailed content of Detailed explanation of the example code of mysql innodb monitoring (system layer, database layer). For more information, please follow other related articles on the PHP Chinese website!