一次诊断事务量突高的原因
收到监控短信,说更新和插入阀值报警,于是登陆mysql-monitor上查看,确实如此,如图:登陆mysql服务器上,通过binlog分析,17:05之前和之后的,看是哪个表更新
收到监控短信,说更新和插入阀值报警,于是登陆mysql-monitor上查看,确实如此,美国空间,如图:
登陆mysql服务器上,通过binlog分析,17:05之前和之后的,看是哪个表更新较大。
[root@XXX-02 logs]# mysqlbinlog --no-defaults --base64-output=decode-rows -v -v mysql-bin.053373 |more
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#120802 16:36:47 server id 4713306 end_log_pos 106 Start: binlog v 4, server v 5.1.43sp1-br38368-enterprise-gpl-pro-log c
reated 120802 16:36:47
然后用这条命令分析,得出写操作频繁的表
[root@XXX-02 logs]# mysqlbinlog --no-defaults --base64-output=decode-rows -v -v mysql-bin.053373 |awk '/###/{if($0~/UPDATE|INSERT|DELETE/)count[$2" "$NF]++}END{for(i in count)print i,"\t",count[i]}' | column -t | sort -k3nr | more
UPDATE DB.Dynamic 133971
UPDATE DB.User 54834
UPDATE DB.Quota 24938
UPDATE DB.OrderHistory 24482
UPDATE DB.BOSSOperation 19767
UPDATE DB.SmsCount 18235
UPDATE DB.Buddy 10919
INSERT DB.Buddy_Log 10024
=====================================================================
接着查看17:05之后的binlog日志。
[root@XXX-02 logs]# mysqlbinlog --no-defaults --base64-output=decode-rows -v -v mysql-bin.053375 |more
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#120802 17:10:54 server id 4713306 end_log_pos 106 Start: binlog v 4, server v 5.1.43sp1-br38368-enterprise-gpl-pro-log c
reated 120802 17:10:54
# at 106
然后用这条命令分析,得出写操作频繁的表
[root@XXX-02 logs]# mysqlbinlog --no-defaults --base64-output=decode-rows -v -v mysql-bin.053375 |awk '/###/{if($0~/UPDATE|INSERT|DELETE/)count[$2" "$NF]++}END{for(i in count)print i,"\t",count[i]}' | column -t | sort -k3nr
INSERT DB.Buddy_Log 194160
INSERT DB.Buddy 192587
UPDATE DB.Dynamic 62767
UPDATE DB.User 30103
UPDATE DB.OrderHistory 12507
UPDATE DB.Quota 12318
UPDATE DB.BOSSOperation 9892
这样比较直观的显示出哪些表更新较多,然后找开发确认问题,是否是业务增长导致。
本文出自 “贺春旸的技术专栏” 博客,网站空间,请务必保留此出处
,香港虚拟主机
Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Why does wireless screencasting fail to connect? Some friends have reported that the connection fails when using wireless screen mirroring. What is going on? What should I do if the wireless screen mirroring connection fails? Please confirm whether your computer, TV and mobile phone are connected to the same WiFi network. Screen mirroring software requires devices to be on the same network to work properly, and Quick Screen Mirroring is no exception. Therefore, please quickly check your network settings. It is important to determine whether the screen mirroring function is supported. Smart TVs and mobile phones usually support DLNA or AirPlay functionality. If the screencast function is not supported, screencasting will not be possible. Confirm whether the device is connected correctly: There may be multiple devices under the same WiFi. Make sure you are connecting to the device you want to share the screen with. 4. Ensure that the network

When connecting a printer to a local area network and starting a print job, some minor problems may occur. For example, the problem "wpsoffice cannot start the print job..." occasionally occurs, resulting in the inability to print out files, etc., delaying our work and study, and causing a bad impact. , let me tell you how to solve the problem that wpsoffice cannot start the print job? Of course, you can upgrade the software or upgrade the driver to solve the problem, but this will take you a long time. Below I will give you a solution that can be solved in minutes. First of all, I noticed that wpsoffice cannot start the print job, resulting in the inability to print. To solve this problem, we need to investigate one by one. Also, make sure the printer is powered on and connected. Generally, abnormal connection will cause

A Comprehensive Guide to PHP 500 Errors: Causes, Diagnosis, and Fixes During PHP development, we often encounter errors with HTTP status code 500. This error is usually called "500InternalServerError", which means that some unknown errors occurred while processing the request on the server side. In this article, we will explore the common causes of PHP500 errors, how to diagnose them, and how to fix them, and provide specific code examples for reference. Common causes of 1.500 errors 1.

I believe many friends have encountered the problem of system blue screen, but I don’t know what is the cause of win11 blue screen. In fact, there are many reasons for system blue screen, and we can investigate and solve them in order. Reasons for win11 blue screen: 1. Insufficient memory 1. It may occur when running too many software or the game consumes too much memory. 2. Especially now there is a memory overflow bug in win11, so it is very likely to be encountered. 3. At this time, you can try to set up virtual memory to solve the problem, but the best way is to upgrade the memory module. 2. CPU overclocking and overheating 1. The causes of CPU problems are actually similar to those of memory. 2. It usually occurs when using post-processing, modeling and other software, or when playing large-scale games. 3. If the CPU consumption is too high, a blue screen will appear.

Some users may encounter slow charging speeds when using Apple phones. There are many reasons for this problem. It may be caused by low power of the charging device, device failure, problems with the USB interface of the mobile phone, or even battery aging and other factors. Why does Apple mobile phone charge very slowly? Answer: charging equipment problem, mobile phone hardware problem, mobile phone system problem. 1. When users use charging equipment with relatively low power, the charging speed of the mobile phone will be very slow. 2. Using third-party inferior chargers or charging cables will also cause slow charging. 3. It is recommended that users use the official original charger, or replace it with a regular certified high-power charger. 4. There is a problem with the user’s mobile phone hardware. For example, the USB interface of the mobile phone cannot be contacted.

Some friends encountered the problem of installation failure when installing Windows 10 drivers, but they did not know the cause of the failure or how to solve it. There are several different reasons for this problem. Please follow me to find out below. Reasons why win10 driver installation fails: 1. System version Currently, Windows 10 system already has the function of automatically installing drivers. The introduction of this feature eliminates the need for users to manually search and install drivers when installing the system. The system will automatically detect and install appropriate drivers, providing a more convenient experience. If your driver installation fails, one solution is to try updating your system. This may fix some system-related issues, allowing the driver to

Explore the causes and solutions of HTTP status code 550 Introduction: In network communications, HTTP status codes play an important role and are used to indicate the results of the server processing the request. Among them, HTTP status code 550 is a relatively rare status code that is usually related to the server refusing to execute the request. This article will explore the causes of HTTP status code 550 and provide solutions. 1. The basic concept of HTTP status code. Before understanding the HTTP status code 550, let us first briefly understand the basic concept of HTTP status code.

Recently, a friend encountered the problem of Win11 automatically shutting down after updating the system. In many cases, it happens when playing games. I don’t know what caused it. In fact, this may be caused by insufficient computer configuration or system failure. Let’s take a look at the causes and solutions. Why does win11 automatically shut down? 1. Insufficient configuration 1. Windows 11 system has higher CPU and memory requirements than Windows 10. 2. Especially when running large-scale games and other tasks, it is very easy to automatically shut down. 3. Users can try to restore the usage status before automatic shutdown by right-clicking the start menu icon and opening the "Task Manager" page. 4. Let’s check the CPU, memory, and disk on this page.
