The old driver will take you to experience a variety of new ways of playing the SYS library

Guided reading

How to use the sys library to do some monitoring more happily?

Come, keep up with the old drivers, and experience a variety of new ways of playing the sys library~

Among the new features of MySQL 5.7, one of the most prominent features is the sys library, which can not only collect MySQL information through the sys library, but also monitor and troubleshoot problems.

But do you know that there are actually many ways to play in the sys library, some of which may be known just by looking at the name of the watch, but some still need the old driver to lead the way~

1. User, connection class

  1. View the resource consumption of connections from each client IP.

2. View the resource consumption of each user

3. Check the current connection status (there should be as many lines as there are connections)

4. Viewing the currently executing SQL is equivalent to executing show full processlist.

2. SQL and io classes

1. View the top three files with IO requests.

Three, buffer pool, memory

1. Check how much memory is allocated in total.

2. How much buffer pool each database occupies

3. Count the innodb cache of the innodb engine

pages refers to the number of pages in the buffer pool; pages_old refers to the pages in the bottom 37% of the LRU list.

When the buffer pages are not enough, the space occupied by these pages will be requisitioned. 37% is the default location, which can be customized.

4. Count the specific situation of each table in InnoDB, such as how many pages it occupies?

In fact, the total number of pages and the third example are equal, you can use the sum (pages) operation to verify it!

5. Query how much memory is allocated for each connection (my machine has no business, so it is a bit unbearable), and use the session table and the memory_by_thread_by_current_bytes allocation table to perform an associated query.

Fourth, fields, indexes, locks

1. View the maximum value and current value of the auto-increment field in the table, and sometimes monitor the data growth, which can be used as a reference. When you use it, you do not have to add a conditional statement.

2. MySQL index usage statistics

3. What are the redundant and useless indexes in MySQL

If there is no redundant index shown in the library, there is no data; when there is a joint index idx_abc(a,b,c) and idx_a(a), then idx_a is a redundant index.

4. View INNODB lock information

Will be removed in a future version, other ways can be used

5. View the lock information at the library level. This needs to open the monitoring of MDL locks first:

5. Thread class

1. There are multiple threads running inside MySQL, the type and number of threads.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324740567&siteId=291194637