Home Database Mysql Tutorial mysql show status详解_MySQL

mysql show status详解_MySQL

Jun 01, 2016 pm 01:32 PM
mysql information server

bitsCN.com

查看服务器目前状态信息的命令,两种方式:

1.      命令行,进入mysql/bin目录下,输入mysqladmin extended-status

2.      连接到mysql,输入show status;

3.      如果要查看某个数据,可以

mysql> show status like 'table%';

+-----------------------+-------+

| Variable_name        | Value |

+-----------------------+-------+

| Table_locks_immediate | 12   |

| Table_locks_waited    | 0    |

+-----------------------+-------+

 

需要关注的部分有:

qcache% ,open%tables,threads%,%key_read%,created_tmp%,sort%,com_select

这几个变量的调优参考“mysql服务器调优”http://www.ibm.com/developerworks/cn/linux/l-tune-lamp-3.html

状态变量详解,可能还有部分新的变量没列出来,

全部状态解释参看mysql手册http://dev.mysql.com/doc/refman/5.0/en/server-status-variables.html(红色部分是调优的时候重点关注的变量)

 

Aborted_clients

指出由于某种原因客户程序不能正常关闭连接而导致失败的连接的数量。如果客户不在退出之前调整mysql_close()函数,wait_timeout或interactive_timeout的限制已经被超出,或者是客户端程序在传输的过程中被关闭,则这种情况会发生。

Aborted_connects

指出试图连接到MYSQL的失败的次数。这种情况在客户尝试用错误的密码进行连接时,没有权限进行连接时,为获得连接的数据包所花费的时间超过了connect_timeout限制的秒数,或数据包中没有包含正确的信息时,都会发生。

Bytes_received

从客户处已经接收到的字节数。

Bytes_sent

已经发送给所有客户的字节数。

Com_[statement]

用于每一种语句的这些变量中的一种。变量值表示这条语句被执行的次数,如com_select,表示查询语句被执行的次数。

Connections

试图连接到MYSQL服务器的次数。

Created_tmp_disk_tables

执行语句时,磁盘上生成的隐含临时表的数量

Created_tmp_tables

执行语句时,内存中生成的隐含临时表的数量

Created_tmp_files

由mysqld生成的临时文件的数量

Delayed_insert_threads

当前正在使用的延迟插入句柄的线程数量

Delayed_writes

由INSERT DELAYED语句写入的记录的个数

Delayed_errors

当发生错误时,由INSERT DELAYED语句写入的记录的。绝大多数普通的错误是复制键

Flush_commands

被执行的FLUSH语句的个数

Handler_commit

内部COMMIT命令的个数

Handler_delete

从一个表中删除行的次数

Handler_read_first

一条索引中的第一个条目被读取的次数,通常是指完全索引扫描(例如,假定indexed_col被索引,语句SELECT indexed_col from tablename导致了一个完全索引扫描)

Handler_read_key

当读取一行数据时,使用索引的请求的个数。如果查询时使用了索引,就希望这个值快速增加

Handler_read_next

按照索引顺序读取下一行数据的请求的个数。如果使用了完全索引进行扫描,或者在一个不变的范围内查询一个索引,则这个值就会增加

Handler_read_prev

按照索引的顺序读取前面一行数据的请求的个数。这个变量值由SELECT fieldlist ORDER BY fields DESC类型的语句使用

Handler_read_rnd

在固定的位置读取一行数据的请求的个数。要求结果被保存起来的查询操作将增加这个计数器的值

Handler_read_rnd_next

读取数据文件中下一行数据的请求的个数。一般,这个值不能太高,因为这意味着查询操作不会使用索引,并且必须从数据文件中读取

Handler_rollback

内部ROLLBACK命令的数量

Handler_update

在表中更新一条记录的请求的数量

Handler_write

在表中插入一条记录的请求的数量

Key_blocks_used

用在键的缓存中的数据块的数量

Key_read_requests

引起从键的缓存读取键的数据块的请求的数量。Key_reads与Key_read_requests的比率不应该高于1:100(也就是,1:10很糟糕)

Key_reads

引起从磁盘读取键的数据块的物理读取操作的数量。

Key_write_requests

引起键的数据块被写入缓存的请求的数量

Key_writes

向磁盘写入键的数据块的物理写操作的次数

Max_used_connections

在任意时刻,正在使用的连接的最大数量

Not_flushed_key_blocks

在键的缓存中,已经发生了改变但还没有被刷新到磁盘上的键的数据块的数量

Not_flushed_delayed_rows

当前在INSERT DELAY队列中,等待被写入的记录的个数

Open_tables

目前打开的表的数量

Open_files

当前打开的文件的数量

Open_streams

当前打开的流数据的数量。这些流数据主要用于日志记录

Opened_tables

已经被打开的表的数量

Questions

初始的查询操作的总数

Qcache_queries_in_cache

缓存中查询的个数

Qcache_inserts

添加到缓存中的查询的个数命中次数除以插入次数就是不中比率;用1减去这个值就是命中率

Qcache_hits

查询缓存被访问的个数

Qcache_lowmem_prunes

缓存出现内存不足并且必须要进行清理以便为更多查询提供空间的次数。这个数字最好长时间来看;如果这个数字在不断增长,就表示可能碎片非常严重,或者内存很少。(上面的free_blocksfree_memory可以告诉您属于哪种情况)。

Qcache_not_cached

没有被缓存(由于太大,或因为QUERY_CACHE_TYPE)的查询的数量

Qcache_free_memory

仍然可用于查询缓存的内存的数量

Qcache_free_blocks

在查询缓存中空闲内存块的数量,数量大说明可能有碎片

Qcache_total_blocks

在查询缓存中数据块的总数

Rpl_status

完全复制的状态(这个变量只在MYSQL 4之后的版本中使用)

Select_full_join

已经被执行的没有使用索引的联接的数量。不能将这个变量值设的太高

Handler_rollback

内部ROLLBACK语句的数量

Handler_update

在表内更新一行的请求数

Handler_write

在表内插入一行的请求数

Innodb_buffer_pool_pages_data

包含数据的页数(脏或干净)

Innodb_buffer_pool_pages_dirty

当前的脏页数

Innodb_buffer_pool_pages_flushed

要求清空的缓冲池页数

Innodb_buffer_pool_pages_free

空页数

Innodb_buffer_pool_pages_latched

在InnoDB缓冲池中锁定的页数。这是当前正读或写或由于其它原因不能清空或删除的页数

Innodb_buffer_pool_pages_misc

忙的页数,因为它们已经被分配优先用作管理,例如行锁定或适用的哈希索引。该值还可以计算为Innodb_buffer_pool_pages_totalInnodb_buffer_pool_pages_freeInnodb_buffer_pool_pages_data

Innodb_buffer_pool_pages_total

缓冲池总大小(页数)

Innodb_buffer_pool_read_ahead_rnd

InnoDB初始化的“随机”read-aheads数。当查询以随机顺序扫描表的一大部分时发生

Innodb_buffer_pool_read_ahead_seq

InnoDB初始化的顺序read-aheads数。当InnoDB执行顺序全表扫描时发生

Innodb_buffer_pool_read_requests

InnoDB已经完成的逻辑读请求数

Innodb_buffer_pool_reads

不能满足InnoDB必须单页读取的缓冲池中的逻辑读数量

Innodb_buffer_pool_wait_free

一般情况,通过后台向InnoDB缓冲池写。但是,如果需要读或创建页,并且没有干净的页可用,则它还需要先等待页面清空。该计数器对等待实例进行记数。如果已经适>当设置缓冲池大小,该值应小

Innodb_buffer_pool_write_requests

向InnoDB缓冲池的写数量

Innodb_data_fsyncs

fsync()操作数

Innodb_data_pending_fsyncs

当前挂起的fsync()操作数

Innodb_data_pending_reads

当前挂起的读数

Innodb_data_pending_writes

当前挂起的写数

Innodb_data_read

至此已经读取的数据数量(字节)

Innodb_data_reads

数据读总数量

Innodb_data_writes

数据写总数量

Innodb_data_written

至此已经写入的数据量(字节)

Innodb_dblwr_writes,

Innodb_dblwr_pages_written已经执行的双写操作数量和为此目的已经写好的页数。

Innodb_log_waits

我们必须等待的时间,因为日志缓冲区太小,我们在继续前必须先等待对它清空

Innodb_buffer_pool_bytes_data

当前bufferpool缓存的数据大小,包括脏数据

Key_blocks_unused

未使用的缓存簇(blocks)数

Key_blocks_used

曾经用到的最大的blocks数

Key_blocks_unused

太小要么增加key_buffer_size,要么就是过渡索引了,把缓存占满了。

  

bitsCN.com
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1253
24
Laravel Introduction Example Laravel Introduction Example Apr 18, 2025 pm 12:45 PM

Laravel is a PHP framework for easy building of web applications. It provides a range of powerful features including: Installation: Install the Laravel CLI globally with Composer and create applications in the project directory. Routing: Define the relationship between the URL and the handler in routes/web.php. View: Create a view in resources/views to render the application's interface. Database Integration: Provides out-of-the-box integration with databases such as MySQL and uses migration to create and modify tables. Model and Controller: The model represents the database entity and the controller processes HTTP requests.

MySQL and phpMyAdmin: Core Features and Functions MySQL and phpMyAdmin: Core Features and Functions Apr 22, 2025 am 12:12 AM

MySQL and phpMyAdmin are powerful database management tools. 1) MySQL is used to create databases and tables, and to execute DML and SQL queries. 2) phpMyAdmin provides an intuitive interface for database management, table structure management, data operations and user permission management.

MySQL vs. Other Programming Languages: A Comparison MySQL vs. Other Programming Languages: A Comparison Apr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

Solve database connection problem: a practical case of using minii/db library Solve database connection problem: a practical case of using minii/db library Apr 18, 2025 am 07:09 AM

I encountered a tricky problem when developing a small application: the need to quickly integrate a lightweight database operation library. After trying multiple libraries, I found that they either have too much functionality or are not very compatible. Eventually, I found minii/db, a simplified version based on Yii2 that solved my problem perfectly.

Laravel framework installation method Laravel framework installation method Apr 18, 2025 pm 12:54 PM

Article summary: This article provides detailed step-by-step instructions to guide readers on how to easily install the Laravel framework. Laravel is a powerful PHP framework that speeds up the development process of web applications. This tutorial covers the installation process from system requirements to configuring databases and setting up routing. By following these steps, readers can quickly and efficiently lay a solid foundation for their Laravel project.

Solve MySQL mode problem: The experience of using the TheliaMySQLModesChecker module Solve MySQL mode problem: The experience of using the TheliaMySQLModesChecker module Apr 18, 2025 am 08:42 AM

When developing an e-commerce website using Thelia, I encountered a tricky problem: MySQL mode is not set properly, causing some features to not function properly. After some exploration, I found a module called TheliaMySQLModesChecker, which is able to automatically fix the MySQL pattern required by Thelia, completely solving my troubles.

MySQL: Structured Data and Relational Databases MySQL: Structured Data and Relational Databases Apr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL: Key Features and Capabilities Explained MySQL: Key Features and Capabilities Explained Apr 18, 2025 am 12:17 AM

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

See all articles