mysql status记录

来源:互联网 发布:ie11浏览器修复软件 编辑:程序博客网 时间:2024/06/11 05:19

================================================================

Several status variables provide statement counts. To determine the number of statements executed, use these relationships:

**SUM(Com_xxx) + Qcache_hits
= Questions + statements executed within stored programs
= Queries**
Many status variables are reset to 0 by the FLUSH STATUS statement.

================================================================
Qcache_free_blocks

The number of free memory blocks in the query cache.

Qcache_free_memory

The amount of free memory for the query cache.

Qcache_hits

The number of query cache hits.

The discussion at the beginning of this section indicates how to relate this statement-counting status variable to other such variables.

Qcache_inserts

The number of queries added to the query cache.

Qcache_lowmem_prunes

The number of queries that were deleted from the query cache because of low memory.

Qcache_not_cached

The number of noncached queries (not cacheable, or not cached due to the query_cache_type setting).

Qcache_queries_in_cache

The number of queries registered in the query cache.

Qcache_total_blocks

The total number of blocks in the query cache.

===============================================================

Queries

The number of statements executed by the server. This variable includes statements executed within stored programs, unlike the Questions variable. It does not count COM_PING or COM_STATISTICS commands.

The discussion at the beginning of this section indicates how to relate this statement-counting status variable to other such variables.

Questions

The number of statements executed by the server. This includes only statements sent to the server by clients and not statements executed within stored programs, unlike the Queries variable. This variable does not count COM_PING, COM_STATISTICS, COM_STMT_PREPARE, COM_STMT_CLOSE, or COM_STMT_RESET commands.

The discussion at the beginning of this section indicates how to relate this statement-counting status variable to other such variables.

==============================================================

Created_tmp_disk_tables

The number of internal on-disk temporary tables created by the server while executing statements.

If an internal temporary table is created initially as an in-memory table but becomes too large, MySQL automatically converts it to an on-disk table. The maximum size for in-memory temporary tables is the minimum of the tmp_table_size and max_heap_table_size values. If Created_tmp_disk_tables is large, you may want to increase the tmp_table_size or max_heap_table_size value to lessen the likelihood that internal temporary tables in memory will be converted to on-disk tables.

You can compare the number of internal on-disk temporary tables created to the total number of internal temporary tables created by comparing the values of the Created_tmp_disk_tables and Created_tmp_tables variables.

See also Section 8.4.4, “Internal Temporary Table Use in MySQL”.

Created_tmp_files

How many temporary files mysqld has created.

Created_tmp_tables

The number of internal temporary tables created by the server while executing statements.

You can compare the number of internal on-disk temporary tables created to the total number of internal temporary tables created by comparing the values of the Created_tmp_disk_tables and Created_tmp_tables variables.

See also Section 8.4.4, “Internal Temporary Table Use in MySQL”.

Each invocation of the SHOW STATUS statement uses an internal temporary table and increments the global Created_tmp_tables value.

===============================================================

Innodb_row_lock_current_waits

The number of row locks currently being waited for by operations on InnoDB tables.

Innodb_row_lock_time

The total time spent in acquiring row locks for InnoDB tables, in milliseconds.

Innodb_row_lock_time_avg

The average time to acquire a row lock for InnoDB tables, in milliseconds.

Innodb_row_lock_time_max

The maximum time to acquire a row lock for InnoDB tables, in milliseconds.

Innodb_row_lock_waits

The number of times operations on InnoDB tables had to wait for a row lock.

Innodb_rows_deleted

The number of rows deleted from InnoDB tables.

Innodb_rows_inserted

The number of rows inserted into InnoDB tables.

Innodb_rows_read

The number of rows read from InnoDB tables.

Innodb_rows_updated

The number of rows updated in InnoDB tables.

===============================================================

Key_blocks_not_flushed

The number of key blocks in the MyISAM key cache that have changed but have not yet been flushed to disk.

Key_blocks_unused

The number of unused blocks in the MyISAM key cache. You can use this value to determine how much of the key cache is in use; see the discussion of key_buffer_size in Section 5.1.5, “Server System Variables”.

Key_blocks_used

The number of used blocks in the MyISAM key cache. This value is a high-water mark that indicates the maximum number of blocks that have ever been in use at one time.

Key_read_requests

The number of requests to read a key block from the MyISAM key cache.

Key_reads

The number of physical reads of a key block from disk into the MyISAM key cache. If Key_reads is large, then your key_buffer_size value is probably too small. The cache miss rate can be calculated as Key_reads/Key_read_requests.

Key_write_requests

The number of requests to write a key block to the MyISAM key cache.

Key_writes

The number of physical writes of a key block from the MyISAM key cache to disk

================================================================

Threads_cached

The number of threads in the thread cache.

This variable is not meaningful in the embedded server (libmysqld) and as of MySQL 5.7.2 is no longer visible within the embedded server.

Threads_connected**(当前连接数)**

The number of currently open connections.

Threads_created

The number of threads created to handle connections. If Threads_created is big, you may want to increase the thread_cache_size value. The cache miss rate can be calculated as Threads_created/Connections.

Threads_running

The number of threads that are not sleeping. (活跃连接数)

Uptime

The number of seconds that the server has been up.

================================================================