To check the operating status of MySQL, and to optimize the operating efficiency of MySQL, it is necessary to run show status to check various statuses. The following is a detailed explanation in Chinese with reference to official documents and online materials:
If you have any questions, please correct me
state name |
scope |
explain in detail |
Aborted_clients |
Global |
The number of connections that were interrupted due to client termination due to the client not closing the connection properly |
Aborted_connects |
Global |
The number of failed connections trying to connect to the MySQL server |
Binlog_cache_disk_use |
Global |
Number of transactions that use a temporary binary log cache but exceed the binlog_cache_size value and use a temporary file to hold statements within a transaction |
Binlog_cache_use |
Global |
The number of transactions cached using the temporary binary log |
Bytes_received |
Both |
The number of bytes received from all clients. |
Bytes_sent |
Both |
The number of bytes sent to all clients. |
with* |
|
The number of various database operations |
Compression |
Session |
Whether to enable only compression protocol between client and server |
Connections |
Global |
Number of connections trying to connect (whether successful or not) to the MySQL server |
Created_tmp_disk_tables |
Both |
The number of temporary tables that are automatically created on disk when the server executes a statement |
Created_tmp_files |
Global |
The number of temporary files that mysqld has created |
Created_tmp_tables |
Both |
The number of in-memory temporary tables that are automatically created by the server when executing a statement. If Created_tmp_disk_tables is large, you may want to increase the tmp_table_size value to make the temp table based on memory rather than disk |
Delayed_errors |
Global |
The number of wrong rows (possibly duplicate key) written with INSERT DELAYED. |
Delayed_insert_threads |
Global |
The number of INSERT DELAYED processor threads used. |
Delayed_writes |
Global |
INSERT DELAYED rows written |
Flush_commands |
Global |
The number of FLUSH statements executed. |
Handler_commit |
Both |
Internal commit statement count |
Handler_delete |
Both |
The number of times a row was deleted from the table. |
Handler_discover |
Both |
The MySQL server can ask the NDB CLUSTER storage engine if it knows about a table by a certain name. This is called discovery. Handler_discover describes the number of discoveries by this method. |
Handler_prepare |
Both |
A counter for the prepare phase of two-phase commit operations. |
Handler_read_first |
Both |
The number of times the first entry in the index was read. If high, it suggests that the server is doing a lot of full index scans; for example, SELECT col1 FROM foo, assuming that col1 has an index. |
Handler_read_key |
Both |
The number of requests to read a row by key. If it is higher, the query and the index of the table are correct. |
Handler_read_next |
Both |
The number of requests to read the next line in key order. This value increases if you query the indexed column with a range constraint or if you perform an index scan. |
Handler_read_prev |
Both |
The number of requests to read the previous row in key order. This read method is mainly used to optimize ORDER BY ... DESC. |
Handler_read_rnd |
Both |
The number of requests to read a line based on a fixed position. This value is higher if you are performing a large number of queries and need to sort the results. You may be using a lot of queries that require MySQL to scan the entire table or your joins are not using keys correctly. |
Handler_read_rnd_next |
Both |
The number of requests to read the next line in the data file. This value is higher if you are doing a lot of table scans. It usually means that your table index is incorrect or that the query written does not take advantage of the index. |
Handler_rollback |
Both |
The number of internal ROLLBACK statements. |
Handler_savepoint |
Both |
The number of requests to place a savepoint on a storage engine. |
Handler_savepoint_rollback |
Both |
A number of rollbacks to a savepoint at the request of a storage engine. |
Handler_update |
Both |
The number of requests to update a row within the table. |
Handler_write |
Both |
The number of requests to insert a row into the table. |
Innodb_buffer_pool_pages_data |
Global |
Number of pages (dirty or clean) containing data. |
Innodb_buffer_pool_pages_dirty |
Global |
The current number of dirty pages. |
Innodb_buffer_pool_pages_flushed |
Global |
要求清空的缓冲池页数 |
Innodb_buffer_pool_pages_free |
Global |
空页数。 |
Innodb_buffer_pool_pages_latched |
Global |
在InnoDB缓冲池中锁定的页数。这是当前正读或写或由于其它原因不能清空或删除的页数。 |
Innodb_buffer_pool_pages_misc |
Global |
忙的页数,因为它们已经被分配优先用作管理,例如行锁定或适用的哈希索引。该值还可以计算为Innodb_buffer_pool_pages_total - Innodb_buffer_pool_pages_free - Innodb_buffer_pool_pages_data。 |
Innodb_buffer_pool_pages_total |
Global |
缓冲池总大小(页数)。 |
Innodb_buffer_pool_read_ahead_rnd |
Global |
InnoDB初始化的“随机”read-aheads数。当查询以随机顺序扫描表的一大部分时发生。 |
Innodb_buffer_pool_read_ahead_seq |
Global |
InnoDB初始化的顺序read-aheads数。当InnoDB执行顺序全表扫描时发生。 |
Innodb_buffer_pool_read_requests |
Global |
InnoDB已经完成的逻辑读请求数。 |
Innodb_buffer_pool_reads |
Global |
不能满足InnoDB必须单页读取的缓冲池中的逻辑读数量。 |
Innodb_buffer_pool_wait_free |
Global |
一般情况,通过后台向InnoDB缓冲池写。但是,如果需要读或创建页,并且没有干净的页可用,则它还需要先等待页面清空。该计数器对等待实例进行记数。如果已经适当设置缓冲池大小,该值应小。 |
Innodb_buffer_pool_write_requests |
Global |
向InnoDB缓冲池的写数量。 |
Innodb_data_fsyncs |
Global |
fsync()操作数。 |
Innodb_data_pending_fsyncs |
Global |
当前挂起的fsync()操作数。 |
Innodb_data_pending_reads |
Global |
当前挂起的读数。 |
Innodb_data_pending_writes |
Global |
当前挂起的写数。 |
Innodb_data_read |
Global |
至此已经读取的数据数量(字节)。 |
Innodb_data_reads |
Global |
数据读总数量。 |
Innodb_data_writes |
Global |
数据写总数量。 |
Innodb_data_written |
Global |
至此已经写入的数据量(字节)。 |
Innodb_dblwr_pages_written |
Global |
已经执行的双写操作数量 |
Innodb_dblwr_writes |
Global |
双写操作已经写好的页数 |
Innodb_log_waits |
Global |
我们必须等待的时间,因为日志缓冲区太小,我们在继续前必须先等待对它清空 |
Innodb_log_write_requests |
Global |
日志写请求数。 |
Innodb_log_writes |
Global |
向日志文件的物理写数量。 |
Innodb_os_log_fsyncs |
Global |
向日志文件完成的fsync()写数量。 |
Innodb_os_log_pending_fsyncs |
Global |
挂起的日志文件fsync()操作数量。 |
Innodb_os_log_pending_writes |
Global |
挂起的日志文件写操作 |
Innodb_os_log_written |
Global |
写入日志文件的字节数。 |
Innodb_page_size |
Global |
编译的InnoDB页大小(默认16KB)。许多值用页来记数;页的大小很容易转换为字节。 |
Innodb_pages_created |
Global |
创建的页数。 |
Innodb_pages_read |
Global |
读取的页数。 |
Innodb_pages_written |
Global |
写入的页数。 |
Innodb_row_lock_current_waits |
Global |
当前等待的待锁定的行数。 |
Innodb_row_lock_time |
Global |
行锁定花费的总时间,单位毫秒。 |
Innodb_row_lock_time_avg |
Global |
行锁定的平均时间,单位毫秒。 |
Innodb_row_lock_time_max |
Global |
行锁定的最长时间,单位毫秒。 |
Innodb_row_lock_waits |
Global |
一行锁定必须等待的时间数。 |
Innodb_rows_deleted |
Global |
从InnoDB表删除的行数。 |
Innodb_rows_inserted |
Global |
插入到InnoDB表的行数。 |
Innodb_rows_read |
Global |
从InnoDB表读取的行数。 |
Innodb_rows_updated |
Global |
InnoDB表内更新的行数。 |
Key_blocks_not_flushed |
Global |
键缓存内已经更改但还没有清空到硬盘上的键的数据块数量。 |
Key_blocks_unused |
Global |
键缓存内未使用的块数量。你可以使用该值来确定使用了多少键缓存 |
Key_blocks_used |
Global |
键缓存内使用的块数量。该值为高水平线标记,说明已经同时最多使用了多少块。 |
Key_read_requests |
Global |
从缓存读键的数据块的请求数。 |
Key_reads |
Global |
从硬盘读取键的数据块的次数。如果Key_reads较大,则Key_buffer_size值可能太小。可以用Key_reads/Key_read_requests计算缓存损失率。 |
Key_write_requests |
Global |
将键的数据块写入缓存的请求数。 |
Key_writes |
Global |
向硬盘写入将键的数据块的物理写操作的次数。 |
Last_query_cost |
Session |
用查询优化器计算的最后编译的查询的总成本。用于对比同一查询的不同查询方案的成本。默认值0表示还没有编译查询。 默认值是0。Last_query_cost具有会话范围。 |
Max_used_connections |
Global |
服务器启动后已经同时使用的连接的最大数量。 |
ndb* |
|
ndb集群相关 |
Not_flushed_delayed_rows |
Global |
等待写入INSERT DELAY队列的行数。
|
Open_files |
Global |
打开的文件的数目。 |
Open_streams |
Global |
打开的流的数量(主要用于记录)。 |
Open_table_definitions |
Global |
缓存的.frm文件数量 |
Open_tables |
Both |
当前打开的表的数量。 |
原文地址:http://www.sandzhang.com/blog/2010/04/07/mysql-show-status-explained-detail/ |
||
Opened_files |
Global |
文件打开的数量。不包括诸如套接字或管道其他类型的文件。 也不包括存储引擎用来做自己的内部功能的文件。 |
Opened_table_definitions |
Both |
已经缓存的.frm文件数量 |
Opened_tables |
Both |
已经打开的表的数量。如果Opened_tables较大,table_cache 值可能太小。 |
Prepared_stmt_count |
Global |
当前的预处理语句的数量。 (最大数为系统变量: max_prepared_stmt_count) |
Qcache_free_blocks |
Global |
查询缓存内自由内存块的数量。 |
Qcache_free_memory |
Global |
用于查询缓存的自由内存的数量。 |
Qcache_hits |
Global |
查询缓存被访问的次数。 |
Qcache_inserts |
Global |
加入到缓存的查询数量。 |
Qcache_lowmem_prunes |
Global |
由于内存较少从缓存删除的查询数量。 |
Qcache_not_cached |
Global |
非缓存查询数(不可缓存,或由于query_cache_type设定值未缓存)。 |
Qcache_queries_in_cache |
Global |
登记到缓存内的查询的数量。 |
Qcache_total_blocks |
Global |
查询缓存内的总块数。 |
Queries |
Both |
服务器执行的请求个数,包含存储过程中的请求。 |
Questions |
Both |
已经发送给服务器的查询的个数。 |
Rpl_status |
Global |
失败安全复制状态(还未使用)。 |
Select_full_join |
Both |
没有使用索引的联接的数量。如果该值不为0,你应仔细检查表的索引 |
Select_full_range_join |
Both |
在引用的表中使用范围搜索的联接的数量。 |
Select_range |
Both |
在第一个表中使用范围的联接的数量。一般情况不是关键问题,即使该值相当大。 |
Select_range_check |
Both |
在每一行数据后对键值进行检查的不带键值的联接的数量。如果不为0,你应仔细检查表的索引。 |
Select_scan |
Both |
对第一个表进行完全扫描的联接的数量。 |
Slave_heartbeat_period |
Global |
复制的心跳间隔 |
Slave_open_temp_tables |
Global |
从服务器打开的临时表数量 |
Slave_received_heartbeats |
Global |
从服务器心跳数 |
Slave_retried_transactions |
Global |
本次启动以来从服务器复制线程重试次数 |
Slave_running |
Global |
如果该服务器是连接到主服务器的从服务器,则该值为ON。 |
Slow_launch_threads |
Both |
创建时间超过slow_launch_time秒的线程数。 |
Slow_queries |
Both |
查询时间超过long_query_time秒的查询的个数。 |
Sort_merge_passes |
Both |
排序算法已经执行的合并的数量。如果这个变量值较大,应考虑增加sort_buffer_size系统变量的值。 |
Sort_range |
Both |
在范围内执行的排序的数量。 |
Sort_rows |
Both |
已经排序的行数。 |
Sort_scan |
Both |
通过扫描表完成的排序的数量。 |
ssl* |
|
ssl连接相关 |
Table_locks_immediate |
Global |
立即获得的表的锁的次数。 |
Table_locks_waited |
Global |
不能立即获得的表的锁的次数。如果该值较高,并且有性能问题,你应首先优化查询,然后拆分表或使用复制。 |
Threads_cached |
Global |
线程缓存内的线程的数量。 |
Threads_connected |
Global |
当前打开的连接的数量。 |
Threads_created |
Global |
创建用来处理连接的线程数。如果Threads_created较大,你可能要增加thread_cache_size值。缓存访问率的计算方法Threads_created/Connections。 |
Threads_running |
Global |
激活的(非睡眠状态)线程数。 |
Uptime |
Global |
服务器已经运行的时间(以秒为单位)。 |
Uptime_since_flush_status |
Global |
最近一次使用FLUSH STATUS 的时间(以秒为单位)。 |