mysql server status variables Flashcards
Aborted_clients
The number of connections that were aborted because the client died without closing the connection properly. SeeSectionC.5.2.11 “Communication Errors and Aborted Connections”.
Aborted_connects
The number of failed attempts to connect to the MySQL server. SeeSectionC.5.2.11 “Communication Errors and Aborted Connections”.
For additional connection-related information check theConnection_errors_xxxstatus variables and thehost_cachetable.
Binlog_cache_disk_use
The number of transactions that used the temporary binary log cache but that exceeded the value ofbinlog_cache_sizeand used a temporary file to store statements from the transaction.
The number of nontransactional statements that caused the binary log transaction cache to be written to disk is tracked separately in theBinlog_stmt_cache_disk_usestatus variable.
Binlog_cache_use
The number of transactions that used the binary log cache.
Binlog_stmt_cache_disk_use
The number of nontransaction statements that used the binary log statement cache but that exceeded the value ofbinlog_stmt_cache_sizeand used a temporary file to store those statements.
Binlog_stmt_cache_use
The number of nontransactional statements that used the binary log statement cache.
Bytes_received
The number of bytes received from all clients.
Bytes_sent
The number of bytes sent to all clients.
Com_xxx
The Com_xxx statement counter variables indicate the number of times each xxx statement has been executed. There is one status variable for each type of statement. For example Com_delete and Com_update count DELETE and UPDATE statements respectively. Com_delete_multi and Com_update_multi are similar but apply to DELETE and UPDATE statements that use multiple-table syntax.
If a query result is returned from query cache the server increments the Qcache_hits status variable not Com_select. See Section 8.9.3.4 “Query Cache Status and Maintenance”.
All of the Com_stmt_xxx variables are increased even if a prepared statement argument is unknown or an error occurred during execution. In other words their values correspond to the number of requests issued not to the number of requests successfully completed.
The Com_stmt_xxx status variables are as follows:
Com_stmt_prepare
Com_stmt_execute
Com_stmt_fetch
Com_stmt_send_long_data
Com_stmt_reset
Com_stmt_close
Those variables stand for prepared statement commands. Their names refer to the COM_xxx command set used in the network layer. In other words their values increase whenever prepared statement API calls such as mysql_stmt_prepare() mysql_stmt_execute() and so forth are executed. However Com_stmt_prepare Com_stmt_execute and Com_stmt_close also increase for PREPARE EXECUTE or DEALLOCATE PREPARE respectively. Additionally the values of the older statement counter variables Com_prepare_sql Com_execute_sql and Com_dealloc_sql increase for the PREPARE EXECUTE and DEALLOCATE PREPARE statements. Com_stmt_fetch stands for the total number of network round-trips issued when fetching from cursors.
Com_stmt_reprepare indicates the number of times statements were automatically reprepared by the server after metadata changes to tables or views referred to by the statement. A reprepare operation increments Com_stmt_reprepare and also Com_stmt_prepare.
Compression
Whether the client connection uses compression in the client/server protocol.
Connection_errors_accept
The number of errors that occurred during calls toaccept()on the listening port.
Connection_errors_internal
The number of connections refused due to internal errors in the server such as failure to start a new thread or an out-of-memory condition.
Connection_errors_max_connections
The number of connections refused because the servermax_connectionslimit was reached.
Connection_errors_peer_addr
The number of errors that occurred while searching for connecting client IP addresses.
Connection_errors_select
The number of errors that occurred during calls toselect()orpoll()on the listening port. (Failure of this operation does not necessarily means a client connection was rejected.)
Connection_errors_tcpwrap
The number of connections refused by thelibwraplibrary.
Connection_errors_xxx
These variables provide information about errors that occur during the client connection process. They are global only and represent error counts aggregated across connections from all hosts. These variables track errors not accounted for by the host cache (seeSection8.11.5.2 “DNS Lookup Optimization and the Host Cache”) such as errors that are not associated with TCP connections occur very early in the connection process (even before an IP address is known) or are not specific to any particular IP address (such as out-of-memory conditions). These variables were added in MySQL 5.6.5.
Connections
The number of connection attempts (successful or not) to the MySQL server.
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.
Created_tmp_files
How many temporary filesmysqldhas 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 “How MySQL Uses Internal Temporary Tables”.
Each invocation of the SHOW STATUS statement uses an internal temporary table and increments the global Created_tmp_tables value.
Delayed_errors
deprecated as of 5.6.7
Delayed_insert_threads
deprecated as of 5.6.7
Delayed_writes
deprecated as of 5.6.7
Flush_commands
The number of times the server flushes tables whether because a user executed aFLUSH TABLESstatement or due to internal server operation. It is also incremented by receipt of aCOM_REFRESHpacket. This is in contrast toCom_flush which indicates how manyFLUSHstatements have been executed whetherFLUSH TABLESFLUSH LOGS and so forth.
Handler_commit
The number of internalCOMMITstatements.
Handler_delete
The number of times that rows have been deleted from tables.
Handler_external_lock
The server increments this variable for each call to itsexternal_lock()function which generally occurs at the beginning and end of access to a table instance. There might be differences among storage engines. This variable can be used for example to discover for a statement that accesses a partitioned table how many partitions were pruned before locking occurred: Check how much the counter increased for the statement subtract 2 (2 calls for the table itself) then divide by 2 to get the number of partitions locked. This variable was added in MySQL 5.6.2.
Handler_mrr_init
The number of times the server uses a storage engines own Multi-Range Read implementation for table access. This variable was added in MySQL 5.6.1.
Handler_prepare
A counter for the prepare phase of two-phase commit operations.
Handler_read_first
The number of times the first entry in an index was read. If this value is high it suggests that the server is doing a lot of full index scans; for exampleSELECT col1 FROM foo assuming thatcol1is indexed.
Handler_read_key
The number of requests to read a row based on a key. If this value is high it is a good indication that your tables are properly indexed for your queries.
Handler_read_last
The number of requests to read the last key in an index. WithORDER BY the server will issue a first-key request followed by several next-key requests whereas with WithORDER BY DESC the server will issue a last-key request followed by several previous-key requests. This variable was added in MySQL 5.6.1.
Handler_read_next
The number of requests to read the next row in key order. This value is incremented if you are querying an index column with a range constraint or if you are doing an index scan.
Handler_read_prev
The number of requests to read the previous row in key order. This read method is mainly used to optimizeORDER BY … DESC.
Handler_read_rnd
The number of requests to read a row based on a fixed position. This value is high if you are doing a lot of queries that require sorting of the result. You probably have a lot of queries that require MySQL to scan entire tables or you have joins that do not use keys properly.
Handler_read_rnd_next
The number of requests to read the next row in the data file. This value is high if you are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have.
Handler_rollback
The number of requests for a storage engine to perform a rollback operation.
Handler_savepoint
The number of requests for a storage engine to place a savepoint.
Handler_savepoint_rollback
The number of requests for a storage engine to roll back to a savepoint.
Handler_update
The number of requests to update a row in a table.
Handler_write
The number of requests to insert a row in a table.
Innodb_available_undo_logs
The total number of availableInnoDBundo logs. Supplements theinnodb_undo_logssystem variable which reports the number of active undo logs.
Innodb_buffer_pool_bytes_data
The total number of bytes in theInnoDBbuffer poolcontaining data. The number includes bothdirtyand clean pages. For more accurate memory usage calculations than withInnodb_buffer_pool_pages_data whencompressedtables cause the buffer pool to hold pages of different sizes.
Innodb_buffer_pool_bytes_dirty
The total current number of bytes held indirty pagesin theInnoDBbuffer pool. For more accurate memory usage calculations than withInnodb_buffer_pool_pages_dirty whencompressedtables cause the buffer pool to hold pages of different sizes.
Innodb_buffer_pool_dump_status
The progress of an operation to record thepagesheld in theInnoDBbuffer pool triggered by the setting ofinnodb_buffer_pool_dump_at_shutdownorinnodb_buffer_pool_dump_now.
Innodb_buffer_pool_load_status
The progress of an operation towarm uptheInnoDBbuffer poolby reading in a set ofpagescorresponding to an earlier point in time triggered by the setting ofinnodb_buffer_pool_load_at_startuporinnodb_buffer_pool_load_now. If the operation introduces too much overhead you can cancel it by settinginnodb_buffer_pool_load_abort.
Innodb_buffer_pool_pages_data
The number ofpagesin theInnoDBbuffer poolcontaining data. The number includes bothdirtyand clean pages.
Innodb_buffer_pool_pages_dirty
The current number ofdirty pagesin theInnoDBbuffer pool.
Innodb_buffer_pool_pages_flushed
The number of requests toflushpagesfrom theInnoDBbuffer pool.
Innodb_buffer_pool_pages_free
The number of freepagesin theInnoDBbuffer pool.
Innodb_buffer_pool_pages_latched
The number of latchedpagesin theInnoDBbuffer pool. These are pages currently being read or written or that cannot beflushedor removed for some other reason. Calculation of this variable is expensive so it is available only when theUNIV_DEBUGsystem is defined at server build time.
Innodb_buffer_pool_pages_misc
The number ofpagesin theInnoDBbuffer poolthat are busy because they have been allocated for administrative overhead such asrow locksor theadaptive hash index. This value can also be calculated asInnodb_buffer_pool_pages_total–Innodb_buffer_pool_pages_free–Innodb_buffer_pool_pages_data.
Innodb_buffer_pool_pages_total
The total size of theInnoDBbuffer pool inpages.
Innodb_buffer_pool_read_ahead
The number ofpagesread into theInnoDBbuffer poolby theread-aheadbackground thread.
Innodb_buffer_pool_read_ahead_evicted
The number ofpagesread into theInnoDBbuffer poolby theread-aheadbackground thread that were subsequentlyevictedwithout having been accessed by queries.
Innodb_buffer_pool_read_requests
The number of logical read requests made to theInnoDBbuffer pool. These requests could be serviced by returning data that was already in memory or by reading the data from disk into memory first.
Innodb_buffer_pool_reads
The number of logical reads thatInnoDBcould not satisfy from thebuffer pool and had to read directly from disk.
Innodb_buffer_pool_wait_free
Normally writes to theInnoDBbuffer poolhappen in the background. WhenInnoDBneeds to read or create apageand no clean pages are availableInnoDBflushes somedirty pagesfirst and waits for that operation to finish. This counter counts instances of these waits. Ifinnodb_buffer_pool_sizehas been set properly this value should be small.
Innodb_buffer_pool_write_requests
The number of writes done to theInnoDBbuffer pool.
Innodb_data_fsyncs
The number offsync()operations so far. The frequency offsync()calls is influenced by the setting of theinnodb_flush_methodconfiguration option.
Innodb_data_pending_fsyncs
The current number of pendingfsync()operations. The frequency offsync()calls is influenced by the setting of theinnodb_flush_methodconfiguration option.
Innodb_data_pending_reads
The current number of pending reads.
Innodb_data_pending_writes
The current number of pending writes.
Innodb_data_read
The amount of data read since the server was started.
Innodb_data_reads
The total number of data reads.
Innodb_data_writes
The total number of data writes.
Innodb_data_written
The amount of data written so far in bytes.
Innodb_dblwr_pages_written
The number ofpagesthat have been written to thedoublewrite buffer. SeeSection14.2.10.1 “InnoDBDisk I/O”.
Innodb_dblwr_writes
The number of doublewrite operations that have been performed. SeeSection14.2.10.1 “InnoDBDisk I/O”.
Innodb_have_atomic_builtins
Indicates whether the server was built withatomic instructions.
Innodb_log_waits
The number of times that thelog bufferwas too small and awaitwas required for it to beflushedbefore continuing.
Innodb_log_write_requests
The number of write requests for theInnoDBredo log.
Innodb_log_writes
The number of physical writes to theInnoDBredo logfile.
Innodb_num_open_files
The number of filesInnoDBcurrently holds open.
Innodb_os_log_fsyncs
The number offsync()writes done to theInnoDBredo logfiles.
Innodb_os_log_pending_fsyncs
The number of pendingfsync()operations for theInnoDBredo logfiles.
Innodb_os_log_pending_writes
The number of pending writes to theInnoDBredo logfiles.