Home Topics Pagoda Panel How to achieve simple MySQL performance tuning through the Pagoda Panel

How to achieve simple MySQL performance tuning through the Pagoda Panel

Nov 05, 2020 pm 04:38 PM
pagoda panel

The following tutorial column of Pagoda will introduce to you how to achieve simple tuning of MySQL performance through the Pagoda panel. I hope it will be helpful to friends in need!

How to achieve simple MySQL performance tuning through the Pagoda Panel

During the operation of PHP MYSQL architecture websites, various performance problems are often encountered, such as MySQL, PHP, CPU, disk IO, cache, etc., among which MySQL is the bottleneck. It is the most common and difficult to solve factor that affects website performance; usually, we use caching software such as redis and memcached to cache content. This is indeed one of the best solutions, but it requires the support of the website program. However, most commonly used website programs do not support or cannot perfectly support these caching software. Today we will talk about how to optimize MySQL performance through MySQL's own configuration adjustments to alleviate the MySQL bottleneck problem.

Preparation:

1. Pagoda Linux panel official version 5.2.0 (released on 2017/09/20) Beta version 5.2.4

2. MySQL 5.x

Usually MySQL tuning is divided into the following parts:

1. MySQL configuration parameter tuning (needs to be adjusted according to the website’s operating conditions)

2. Data table index tuning (effect Obviously, but usually excellent open source programs do not need to be adjusted)

3. SQL statement tuning (this is what programmers or DBAs do)

Today we mainly talk about how to cooperate with Pagoda To use the new functions of the panel to tune MySQL configuration parameters, let’s first look at two pictures:

(Picture 1)

How to achieve simple MySQL performance tuning through the Pagoda Panel

(Picture 2)

How to achieve simple MySQL performance tuning through the Pagoda Panel

##Obviously, (Figure 1) shows the current running status of MySQL, (Figure 2) shows the main configuration parameters of MySQL

Next we will Let’s interpret these two pictures:

1. Number of active/peak connections

(Figure 1) The current active connection is 1. Since the MySQL service started, the highest number of connections is 54; When the highest number of connections is close to or equal to max_connections in (Figure 2), max_connections should be increased appropriately. It should be noted that do not increase too much at once. It is recommended to increase by 50 each time and observe for a period of time. If it is not enough, continue to increase.

2. Thread cache hit rate

The thread cache hit rate in (Figure 1) is 99.78%. If this value is less than 90%, it is recommended to increase the thread_cache_size in (Figure 2) appropriately. It is recommended Increase by 8 each time.

3. Index hit rate

The index hit rate in (Figure 1) is 99.50%. If this value is less than 95%, it is recommended to increase the key_buffer_size in (Figure 2) appropriately. It is recommended that each time Increase 64. It should be noted that if your database uses the Innodb engine, you can ignore this option

4, Innodb index hit rate

(Figure 1) Innodb index hit rate 100%. If this value is less than 95%, it is recommended to increase the innodb_buffer_pool_size in (Figure 2) appropriately. It is recommended to increase it by 64 each time. It should be noted that if your database does not use the Innodb engine, you can ignore this option

5. Query cache hit rate

MySQL query cache is a controversial function. I personally recommend that when you are using caching software such as redis and memcached, you can set query_cache_size to 0 in (Figure 2). Turn it off. When you are not using caching software, have extra memory usage, and database bottlenecks are obvious, you can try to turn on query caching. This is a function that relies heavily on data table structure and SQL statement optimization. If the data table structure and SQL The statements have been optimized for query caching, and its effect is still very good.

6. Create temporary tables to disk

(Figure 1) The proportion of creating temporary tables to disk is 0.42%, which shows that most of the temporary tables are created in the memory, not too many To increase the cost of disk IO, it is recommended that when the proportion is greater than 2%, increase the tmp_cache_size in (Figure 1) appropriately. It is recommended to increase it by 32 each time. When the proportion is greater than 60%, give up. Some open source programs have not specifically optimized SQL statements. , so a large number of temporary tables will be opened during operation, and no matter how much cache is added, it will not be enough.

7. Open table

When the open table in (Figure 1) is close to or equal to the table_open_cache in (Figure 2), table_open_cache can be increased appropriately, but if it is set It is likely to cause your program to frequently interrupt the MySQL connection. It is recommended that the value be within 1024 and the maximum value should not exceed 2048.

8. The amount of JOIN without index and the amount of JOIN without index

If it is not 0, check the data table index. In fact, as long as there is no crazy increase, for example, how much does it increase in a day? Thousands can generally be ignored. After all, it is more appropriate for programmers or DBAs to optimize indexes.

9. Number of merges after sorting

If this value is increasing slowly, it is recommended to increase the sort_buffer_size in (Figure 2) appropriately. It is recommended to increase it by 512 each time, but the maximum should not exceed 8192. If this value keeps rising, increasing sort_buffer_size is useless, so give up. This is an option. The blame should be placed on the program developers.

10. Number of table locks

If the server has low CPU overhead and locks tables crazily, it is recommended that you convert all data tables to innodb, and remember to back up before conversion.

11. Optimization plan

This is a recommended optimization plan based on the memory size. It is only recommended to be used for basic reference values. Each configuration item should be adjusted according to the actual situation. .

Note: After saving the parameter configuration, it will not take effect immediately. Remember to restart the MySQL service.

The above is the detailed content of How to achieve simple MySQL performance tuning through the Pagoda Panel. For more information, please follow other related articles on the PHP Chinese website!

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months 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)

A brief analysis of the problem that the server cannot be remote after installing Pagoda A brief analysis of the problem that the server cannot be remote after installing Pagoda Nov 23, 2022 pm 04:56 PM

This article uses the Pagoda Panel Tutorial column to introduce to you the problem that server2022 cannot be remote after installing Pagoda. I wonder if you have encountered such a problem? Let me show you how I handle it!

How to set the speed limit of the virtual host through the Pagoda panel How to set the speed limit of the virtual host through the Pagoda panel Jun 21, 2023 am 11:17 AM

Pagoda Panel is a very excellent server management panel under Linux system. It has powerful functions and friendly interface, which can help users manage servers easily. In the process of using the Pagoda Panel, it is sometimes necessary to limit the speed of the virtual host to ensure the stability and fluency of the server. This article will introduce how to set the speed limit of the virtual host through the Pagoda panel to achieve a good user experience. 1. Overview of Speed ​​Limit Speed ​​limit refers to limiting the host bandwidth and ensuring the normal operation of the server by controlling the host traffic. exist

What should I do if I get an error when deploying thinkphp5 in Pagoda? What should I do if I get an error when deploying thinkphp5 in Pagoda? Dec 19, 2022 am 11:04 AM

Solution to the error reported when deploying thinkphp5 in Pagoda: 1. Open the Pagoda server, install the php pathinfo extension and enable it; 2. Configure the ".access" file with the content "RewriteRule ^(.*)$ index.php?s=/$1 [QSA ,PT,L]”; 3. In website management, just enable thinkphp’s pseudo-static.

How to use the Pagoda panel to set up domain name resolution How to use the Pagoda panel to set up domain name resolution Jun 21, 2023 am 09:19 AM

With the development and popularization of the Internet, domain names have become an indispensable part of our online world. However, many people are still confused about the settings of domain name resolution. Today, we will introduce how to use the Pagoda panel to set up domain name resolution. What is DNS? Domain name resolution is the process of binding a domain name to the IP address of the website or server it represents. It is a process that converts human-readable domain names into computer-readable IP addresses. The main components of domain name resolution are: domain name registration, DNS resolution and we

Introduction to the WebDAV file management function of Pagoda Panel Introduction to the WebDAV file management function of Pagoda Panel Jun 21, 2023 am 11:33 AM

Introduction to the WebDAV file management function of Pagoda Panel WebDAV is a file management technology based on the HTTP protocol. It allows users to access files on the network through the HTTP protocol and manage these files. With the support of WebDAV technology, we can build a Web server to provide various network services. Pagoda Panel is a popular web server management tool that provides a wealth of functional modules, among which the WebDAV file management function is one of them. Below, this article

How to use Pagoda Panel for MySQL management How to use Pagoda Panel for MySQL management Jun 21, 2023 am 09:44 AM

Pagoda Panel is a powerful panel software that can help us quickly deploy, manage and monitor servers, especially small businesses or individual users who often need to build websites, database management and server maintenance. Among these tasks, MySQL database management is an important job in many cases. So how to use the Pagoda panel for MySQL management? Next, we will introduce it step by step. Step 1: Install Pagoda Panel. Before starting to use Pagoda Panel for MySQL management, you first need to install Pagoda Panel.

How to use Pagoda Panel for website repair and maintenance How to use Pagoda Panel for website repair and maintenance Jun 21, 2023 pm 03:19 PM

In the current Internet era, websites have become an important means for many companies to display and promote themselves. However, it is inevitable that some unexpected situations will cause the website to be inaccessible or have limited functions. At this time, the website needs to be repaired and maintained. This article will introduce how to use Pagoda Panel for website repair and maintenance. 1. Introduction to Pagoda Panel Pagoda Panel is a website management software running on a Linux server. It can help users quickly build a Web environment on the server operating system. The Pagoda panel integrates numerous functional modules

What is a pagoda panel? how to use? What is a pagoda panel? how to use? Jun 21, 2023 pm 11:21 PM

What is a pagoda panel? how to use? With the rapid development of Internet technology, many website managers and developers are faced with the problem of how to manage their servers and websites quickly and conveniently. For this reason, batches of server management tools have emerged. The Pagoda Panel is one of the most popular server management tools. This article will introduce what the Pagoda Panel is and how to use it. 1. What is a pagoda panel? Pagoda Panel is a server management tool based on Linux operating system. It provides some commonly used server management

See all articles