Home > Database > Mysql Tutorial > Detailed explanation of the example code of mysql innodb monitoring (system layer, database layer)

Detailed explanation of the example code of mysql innodb monitoring (system layer, database layer)

黄舟
Release: 2017-04-13 09:58:24
Original
1646 people have browsed it

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
Copy after login

2, mysql databaselayer


 show global status where Variable_name in('xxxx')或者show global status like 'xxx%'
Copy after login

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, Innodb_buffer_pool_pages_data, Innodb_buffer_pool_pages_free, Innodb_buffer_pool_pages_dirty ;)

      5) Query cache Hit (query cache hit rate)-----(inno_buffer_pool_read_requests, Innodb_buffer_pool_reads)

      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, Innodb_data_writes, Innodb_data_read, Innodb_data_written)

        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, Innodb_os_log_written)

        8) Thread status (number of threads created per second) ----- - (Threads_running, Threads_connected, Threads_created, Threads_cached)

                                                                                                                                                           . 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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template