search
HomeTopicsPagoda PanelHow to achieve simple MySQL performance tuning through the Pagoda Panel

The following tutorial column of Pagoda Panel 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

Simple tuning of MySQL performance through the Pagoda panel

During the operation of the PHP MYSQL architecture website, there are often Encountered various performance problems, such as MySQL, PHP, CPU, disk IO, cache, etc. Among them, MySQL bottleneck is the most common and difficult to solve factor that affects website performance; usually, we will use redis, memcached and other caches Software to cache content is indeed one of the best solutions, but it requires the support of website programs. However, most commonly used website programs do not support or cannot perfectly support these caching software. Today we will talk about how to use MySQL itself Configuration adjustments to optimize MySQL performance to alleviate MySQL bottlenecks.

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, we divide MySQL tuning into the following parts:

1. MySQL configuration parameter tuning (needs to be adjusted according to the operation of the website)

2. Data Table index tuning (the effect is obvious, 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 tune MySQL configuration parameters with the new functions of the Pagoda Panel. Let's first look at two pictures

How to achieve simple MySQL performance tuning through the Pagoda Panel

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

Let’s interpret these two Figure:

1. Number of active/peak connections (Figure 1) There is currently 1 active connection. Since the MySQL service was started, the highest number of connections is 54; when the highest number of connections is close to or equal to (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 it by 50 each time and observe it for a period of time. If it is not enough, continue to increase it.

2. 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 to increase it by 8 each time.

3. Index hit rate (Figure 1) The index hit rate 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 to increase it by 64 each time. Please explain. Yes, if your database uses the Innodb engine, you can ignore this option

4. Innodb index hit rate (Figure 1) The Innodb index hit rate is 100%. If this value is less than 95%, it is recommended to use it appropriately. Increase innodb_buffer_pool_size in (Figure 2). 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 comparison Controversial function, I personally recommend that when you are using caching software such as redis, memcached, etc., you can turn it off by setting query_cache_size to 0 in (Figure 2). When you are not using caching software and there is excess memory usage, and When database bottlenecks are obvious, you can try to enable query caching. This is a function that relies heavily on data table structure and SQL statement optimization. If the data table structure and SQL statements are optimized for query caching, the 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 temporary tables are created in memory and will not increase disk IO overhead too much. 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 during operation A large number of temporary tables will be opened, and no amount of caching will 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), you can increase table_open_cache appropriately, but if the setting is too large, it may cause your program to Frequently interrupt MySQL connections, it is recommended to be within 1024, and the maximum should not exceed 2048.

8. The amount of unused indexes and unused JOIN amounts. If it is not 0, check the data table index. In fact, as long as it does not increase dramatically, such as increasing by thousands a day, it can generally be ignored. After all, it is more appropriate for programmers or DBAs to optimize indexes.

9. The 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 has been rising rapidly, increase sort_buffer_size is useless, so just give up this option. This blame should be left to the program developers.

10. Number of table locks If the server's CPU overhead is low and the table is locked like crazy, 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
This article is reproduced at:segmentfault. If there is any infringement, please contact admin@php.cn delete
浅析server安装宝塔后出现不能远程的问题浅析server安装宝塔后出现不能远程的问题Nov 23, 2022 pm 04:56 PM

本文由宝塔面板教程栏目给大家介绍关于server2022安装宝塔后出现不能远程的问题,不知道大家有没有遇到这样的问题呢?下面就带大家一起来看看我是怎么处理的吧!

宝塔部署thinkphp5报错怎么办宝塔部署thinkphp5报错怎么办Dec 19, 2022 am 11:04 AM

宝塔部署thinkphp5报错的解决办法:1、打开宝塔服务器,安装php pathinfo扩展并启用;2、配置“.access”文件,内容为“RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]”;3、在网站管理里面,启用thinkphp的伪静态即可。

如何使用宝塔面板进行域名解析设置如何使用宝塔面板进行域名解析设置Jun 21, 2023 am 09:19 AM

随着互联网的发展和普及,域名成为了我们在网络世界中不可或缺的一部分。但是,很多人对域名解析的设置仍然感到困惑。今天,我们来介绍如何使用宝塔面板进行域名解析设置。什么是域名解析?域名解析是将域名与其所代表的网站或服务器IP地址进行绑定的过程。它是一个将人们可阅读的域名转化为计算机可读的IP地址的过程。域名解析的主要组成部分有:域名注册、DNS解析和we

如何使用宝塔面板进行MySQL管理如何使用宝塔面板进行MySQL管理Jun 21, 2023 am 09:44 AM

宝塔面板是一种功能强大的面板软件,它可以帮助我们快速部署、管理和监控服务器,尤其是经常需要进行网站搭建、数据库管理以及服务器维护的小型企业或个人用户。在这些任务中,MySQL数据库管理在很多情况下是一个重要的工作。那么如何使用宝塔面板进行MySQL管理呢?接下来,我们将逐步介绍。第一步:安装宝塔面板在开始使用宝塔面板进行MySQL管理之前,首先需要安装宝塔面

宝塔面板php安装扩展失败怎么办宝塔面板php安装扩展失败怎么办Nov 13, 2022 am 09:23 AM

宝塔面板php安装扩展失败的解决办法:1、在软件商城中搜索“工具箱”;2、安装linux工具箱;3、点击“设置”,并设置虚拟内存“1224m”;4、重新安装即可。

宝塔BT面板能同时安装多个php版本吗宝塔BT面板能同时安装多个php版本吗Mar 21, 2023 am 11:49 AM

宝塔BT面板是一款非常实用的服务器管理工具,它可以帮助用户快速地搭建和管理自己的服务器。作为一款实用性很高的工具,宝塔BT面板是目前最受欢迎的服务器管理软件之一。但是,有些人可能会问,宝塔BT面板可以同时安装多个PHP版本吗?下面,我们就来探讨一下这个问题。

宝塔php运行不了怎么办宝塔php运行不了怎么办Oct 27, 2022 am 09:38 AM

宝塔php运行不了的解决办法:1、执行“find / -name libcrypto.so.1.0.0”命令;2、​查找出so所在的目录;3、编辑“/etc/ld.so.conf”文件,加上一行“.so”文件路径;4、更新“/etc/ld.so.cache”;5、重新启动php即可。

如何通过宝塔面板进行UFW防火墙的配置如何通过宝塔面板进行UFW防火墙的配置Jun 21, 2023 am 09:08 AM

在Linux服务器上配置防火墙非常重要,它可以有效地保护服务器免受恶意攻击。在Ubuntu操作系统上,我们可以使用UFW防火墙来保护服务器的安全。在本文中,我们将介绍如何使用宝塔面板配置UFW防火墙。第一步:安装宝塔面板首先,我们需要在Ubuntu上安装宝塔面板。您可以在宝塔官网免费下载宝塔面板的安装包,然后在命令行中运行以下命令来安装宝塔面板:$wget

See all articles

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)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),