Home > Database > Mysql Tutorial > body text

Detailed explanation of MySQL basic configuration optimization

黄舟
Release: 2017-08-02 11:19:23
Original
1336 people have browsed it

When querying a large amount of data, we need to adopt some optimization methods, some basic optimization methods of mysql, and share some of our experiences with everyone.

1.max_connections, the maximum number of connections. If the server has a large number of concurrent connection requests, it is recommended to increase this value. show variables like 'max_connections' Maximum number of connections Let’s check the maximum number of connections

Detailed explanation of MySQL basic configuration optimization

2. Check the real connections Number, execute show status like 'max_used_connections' The number of responses is

Detailed explanation of MySQL basic configuration optimization

3.back_log: MySQL can temporarily store the connections quantity. If the connection data of MySQL reaches max_connections, new requests will be stored in the stack to wait for a certain connection to release resources. The number of the stack is back_log. If the number of waiting connections exceeds back_log, no connection resources will be granted.

Execute show full processlist to view

Detailed explanation of MySQL basic configuration optimization

4.key_buffer_size: Specifies the size of the index buffer, which determines the speed of index processing. Especially the speed of index reading, execute show variables like 'key_buffer_size'; to check it

Detailed explanation of MySQL basic configuration optimization

5. Let's take a look Usage of key_buffer_size Execute

show global status like 'key_read%';
Copy after login

Detailed explanation of MySQL basic configuration optimization

##6.query_cache_size, using the mysql buffer, MySQL stores the query results in the buffer, for the same SELECT statement (case sensitive), the results will be read directly from the buffer. Execute show global status like 'qcache%'; to view, there are many ways to optimize the configuration of mysql

Detailed explanation of MySQL basic configuration optimization


#

The above is the detailed content of Detailed explanation of MySQL basic configuration optimization. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template