Diagnosing MySQL Server Freezes and Stalls, Sometimes Called Crashes

本文主要是介绍Diagnosing MySQL Server Freezes and Stalls, Sometimes Called Crashes,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!


Diagnosing MySQL Server Freezes and Stalls, Sometimes Called Crashes 

转到底部

https://support.oracle.com/epmos/adf/images/t.gif


https://support.oracle.com/epmos/adf/images/t.gif

In this Document

 

Purpose

 

 

Troubleshooting Steps

 

 

1. Check query cache free blocks count.

 

 

2. If using InnoDB, check SHOW ENGINE INNODB STATUS.

 

 

3. Check SHOW PROCESSLIST and search the knowledge base for the text of the values in the State column.

 

 

4. Open a service request.

 

 

References


APPLIES TO:

MySQL Server - Version 4.0 and later
Information in this document applies to any platform.

PURPOSE

Guide to diagnosing the cause of a MySQL Server freeze, stall or similar interruption to service.

TROUBLESHOOTING STEPS

This document is a work in progress with only limited content at this stage. You should open a service request if it does not provide sufficient information to resolve your problem.

This does not cover actual crashes of the MySQL server. Check your running process list using operating system tools like PS or Task Manager. If you see that mysqld is still running this is the guide for you. If it is not still running, check a 
guide to actual crashes.

1. Check query cache free blocks count.

 

SHOW GLOBAL STATUS LIKE 'qcache_free_blocks';
+-------------------------+-------+
| Variable_name           | Value |
+-------------------------+-------+
| Qcache_free_blocks      | 120045|
+-------------------------+-------+



If you see a value above 10,000 it is likely that you need to tune your query cache settings. If you see a value above 50,000 it is possible that removing entries from the query cache could be blocking queries from running. Check for query cache related entries in SHOW PROCESSLIST output. Depending on MySQL server version and the number of free entries the delays could be as much as several minutes. More recent versions bypass the query cache once a timeout expires. As a temporary measure use FLUSH QUERY CACHE to defragment the query cache. It may take several minutes to work. As a longer term solution, see the query cache tuning guide (not yet available). Note that the query cache was designed for sizes of a few megabytes to a few tens of megabytes. Larger sizes than those can have serious adverse performance consequences.

You may also see high CPU use on one CPU core if the query cache is the source of the problem. The query cache only uses one core.

2. If using InnoDB, check SHOW ENGINE INNODB STATUS.


Look at the end of the list of transactions for queries that have been running for many tens, hundreds or thousands of seconds. If you see many such queries, decide whether you can safely KILL them and do that until the problem is resolved. Then work on tuning the queries and setting innodb_thread_concurrency and innodb_concurrency_tickets appropriately.

3. Check SHOW PROCESSLIST and search the knowledge base for the text of the values in the State column.


Many of the states can indicate potential trouble sources and solutions.

4. Open a service request.


Tell us the symptoms, whether it was sudden and whether it has been happening regularly. We will also need this output:
 

SHOW PROCESSLIST;
SHOW ENGINE INNODB STATUS;


Both taken while the problem is happening.
Both a second time a minute or so later, ideally still during the problem. If it is ongoing, repeat a few times with a ten or so minute gap between runs.

 

SHOW VARIABLES;
SHOW GLOBAL STATUS;


Also provide the most recent few thousand lines of the MySQL error log. Do not just start when the problem started, we need at least a  few hundred lines before then, if those lines exist. Going back more than a few days is not necessary.

For longer term monitoring we may ask you to turn on the InnoDB monitor. This regularly writes InnoDB status information to the MySQL Server error log file (usually called <servername>.err in the MySQL data directory. This is useful for monitoring batch jobs or over time to catch periodic problems. To enable it enter this in the client mysql:

 

USE TEST;
CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB;



To disable it after collecting data use:
 

USE TEST;
DROP TABLE innodb_monitor;

 

这篇关于Diagnosing MySQL Server Freezes and Stalls, Sometimes Called Crashes的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/222222

相关文章

MySQL zip安装包配置教程

《MySQLzip安装包配置教程》这篇文章详细介绍了如何使用zip安装包在Windows11上安装MySQL8.0,包括下载、解压、配置环境变量、初始化数据库、安装服务以及更改密码等步骤,感兴趣的朋... 目录mysql zip安装包配置教程1、下载zip安装包:2、安装2.1 解压zip包到安装目录2.2

MySQL安装时initializing database失败的问题解决

《MySQL安装时initializingdatabase失败的问题解决》本文主要介绍了MySQL安装时initializingdatabase失败的问题解决,文中通过图文介绍的非常详细,对大家的学... 目录问题页面:解决方法:问题页面:解决方法:1.勾选红框中的选项:2.将下图红框中全部改为英

MySQL 中的服务器配置和状态详解(MySQL Server Configuration and Status)

《MySQL中的服务器配置和状态详解(MySQLServerConfigurationandStatus)》MySQL服务器配置和状态设置包括服务器选项、系统变量和状态变量三个方面,可以通过... 目录mysql 之服务器配置和状态1 MySQL 架构和性能优化1.1 服务器配置和状态1.1.1 服务器选项

MySQL8.0设置redo缓存大小的实现

《MySQL8.0设置redo缓存大小的实现》本文主要在MySQL8.0.30及之后版本中使用innodb_redo_log_capacity参数在线更改redo缓存文件大小,下面就来介绍一下,具有一... mysql 8.0.30及之后版本可以使用innodb_redo_log_capacity参数来更改

Springboot中分析SQL性能的两种方式详解

《Springboot中分析SQL性能的两种方式详解》文章介绍了SQL性能分析的两种方式:MyBatis-Plus性能分析插件和p6spy框架,MyBatis-Plus插件配置简单,适用于开发和测试环... 目录SQL性能分析的两种方式:功能介绍实现方式:实现步骤:SQL性能分析的两种方式:功能介绍记录

使用 sql-research-assistant进行 SQL 数据库研究的实战指南(代码实现演示)

《使用sql-research-assistant进行SQL数据库研究的实战指南(代码实现演示)》本文介绍了sql-research-assistant工具,该工具基于LangChain框架,集... 目录技术背景介绍核心原理解析代码实现演示安装和配置项目集成LangSmith 配置(可选)启动服务应用场景

oracle DBMS_SQL.PARSE的使用方法和示例

《oracleDBMS_SQL.PARSE的使用方法和示例》DBMS_SQL是Oracle数据库中的一个强大包,用于动态构建和执行SQL语句,DBMS_SQL.PARSE过程解析SQL语句或PL/S... 目录语法示例注意事项DBMS_SQL 是 oracle 数据库中的一个强大包,它允许动态地构建和执行

SQL 中多表查询的常见连接方式详解

《SQL中多表查询的常见连接方式详解》本文介绍SQL中多表查询的常见连接方式,包括内连接(INNERJOIN)、左连接(LEFTJOIN)、右连接(RIGHTJOIN)、全外连接(FULLOUTER... 目录一、连接类型图表(ASCII 形式)二、前置代码(创建示例表)三、连接方式代码示例1. 内连接(I

在MySQL执行UPDATE语句时遇到的错误1175的解决方案

《在MySQL执行UPDATE语句时遇到的错误1175的解决方案》MySQL安全更新模式(SafeUpdateMode)限制了UPDATE和DELETE操作,要求使用WHERE子句时必须基于主键或索引... mysql 中遇到的 Error Code: 1175 是由于启用了 安全更新模式(Safe Upd

轻松上手MYSQL之JSON函数实现高效数据查询与操作

《轻松上手MYSQL之JSON函数实现高效数据查询与操作》:本文主要介绍轻松上手MYSQL之JSON函数实现高效数据查询与操作的相关资料,MySQL提供了多个JSON函数,用于处理和查询JSON数... 目录一、jsON_EXTRACT 提取指定数据二、JSON_UNQUOTE 取消双引号三、JSON_KE