I've recently been accumulating some MySQL configuration variables
that have defaults which have proven to be problematic in a high-volume
production environment. The thing they all have in common is a network
blip or two can trigger some very undesirable behavior.
max_connect_errors
If a client is having trouble connecting to MySQL, the server will give up waiting after connect_timeout
seconds and increment the counter which tracks the number of connect
errors it has seen for the host. Then, when that value reaches max_connect_errors
, the client will be locked out until you issue a FLUSH HOSTS
command. Worse yet, if you have occasionally network blips and never
need to restart your MySQL boxes, these errors can accumulate over time
and eventually cause you middle of the night pain.
See Host 'host name' is blocked
in the MySQL docs. Sadly, there is no way to disable this check entirely
.
Setting the variable to 0 doesn't accomplish that. Your only real
solutions are (a) setting it to a very high value
(max_connect_errors=1844674407370954751), and (b) running an occasional
FLUSH HOSTS
command.
connect_timeout
This is related to the above problem. In situations of network
congestion (either at the client or server), it's possible for an
initial connection to take several seconds to complete. But the default
value for connect_timeout
is 5 seconds. When you trip over that, the max_connect_errors
problem above kicks in.
To avert this, try setting connect_timeout
to a value more like 15 or 20. And also consider making thread_cache_size
a non-zero value. That will help in situations when the server
occasionally gets a high number of new connections in a very short
period of time.
skip-name-resolve
MySQL does a reverse DNS lookup on every incoming connection by
default. This sucks. It seems that no matter how good your
infrastructure is, there are blips in DNS service. MySQL's host cache
exists to keep those lookups to a minimum. Yet I've seen this cause
pain off and on for eight years now. I can only assume there's a bug in
the host cache or the resolver library when this happens.
I recommend adding skip-name-resolve
to your /etc/my.cnf
to skip DNS entirely. Just use IP addresses or ranges for your GRANTs.
It seems that slow replies from DNS servers can also help you to trip
over connect_timeout
as well. Imagine having 2 or 3 DNS servers configured but the first one is unavailable.
slave_net_timeout
When the network connection between a master and slave database is
interrupted in a way that neither side can detect (like a firewall or
routing change), you must wait until slave_net_timeout
seconds have passed before the salve realizes that something is wrong.
It'll then try to reconnect to the master and pick up where it left
off. That's awesome.
However, the default value is 3600 seconds. That's a full hour! FAIL.
Who wants their slaves to sit idle for that long before checking to see if something might be wrong? I can't think of anyone
who wants that.
My suggestion, if you're in a busy environment, is that you set that to something closer to 30 seconds.
分享到:
相关推荐
writing running and fixing codes.one
An Analysis of the Automatic Bug Fixing Performance of ChatGPT.pdf
Finding_Fixing_VoIP_Call_Quality_Issues.pdf
DLL Suite helps repair Windows PC problems By Fixing error in DLL files. include with Cracked
UnREaL RCE / Fixing Armadillo 5.xx Hardware FingerPrint (with Copy-MemII) <br>This tut is about Fixing Armadillo 5.xx Hardware Fingerprint and defeating Copy-MemII Because something changed in ...
20090120_Finding_and_Fixing_VoIP_Call_Quality_Issues.ppt
标题中的"eu m30 d50 p6M macd_ma ea (for fixing) 2 mod2_ea_mt4_"似乎是一种自动交易策略或者Expert Advisor(EA)的名称,用于MetaTrader 4(MT4)平台。让我们逐一解析这个名称中的关键元素: - "eu":通常在...
【标题】:“论文翻译:基于协议的程序自动化修复” 【描述】:该论文翻译探讨了“AutoFix”这一自动修复程序错误的技术,该技术利用协议形式的规范元素进行高质量修复建议,并实现调试过程的自动化。...
「NGFW」AppSecEU2016-Christian-Mainka-Breaking-And-Fixing - 区块链 WAF 网站安全 日志审计 安全测试 安全实践
### 修复TCriticalSection:解决Delphi中的关键节问题 #### 概述 在Delphi编程环境中,TCriticalSection是一种常用的同步对象,用于保护共享资源免受多线程并发访问时的竞争条件。然而,该类存在一个严重的设计...
信息安全_数据安全_AppSecEU2016-Christian-Mainka-Breaking-And-Fixing 移动安全 安全管控 态势感知 大数据 数字风险
首先,研究的标题“Identification of nitrogen-fixing Paenibacillus from different plant rhizospheres”强调了研究的目标是识别和鉴定在不同植物根际土壤中能进行固氮作用的类芽孢杆菌属。固氮作用是某些细菌的...
在IT领域,特别是软件开发过程中,GUID(全局唯一标识符)是极其重要的组成部分,它用于确保数据对象在所有时间和空间中的唯一性。然而,在使用Visual Studio 2010进行开发时,用户可能会遇到GUID创建过程中的错误。...
朱日清、方萍、来桂晓、李亚娟和高松林等人在他们发表的《Effect of Soil Properties on growth and Nitrogenase Activity of Exotic Associative N-fixing Bacteria》一文中,详细探讨了土壤特性如何影响外源固氮菌...
* Windows化 您是突然发现自己被迫进入Windows环境Linux垃圾用户吗? 可能是您的公司正在使您使用Windows,或者是不太技术的朋友正在遇到计算机故障。 无论哪种方式,您都发现自己被Microsoft压迫性外壳cmd.exe压倒...
### 知识点一:Windows系统磁盘检查机制 #### 1.1 CHKDSK命令简介 - **CHKDSK** 是一个用于检测并修复文件系统错误的强大工具,尤其是在Windows操作系统中。它能够扫描指定的磁盘分区或卷,并报告发现的任何文件...
"r-suresh-genuine-error-fixing-in-windows-xp_in_error_gaveybm_"这个标题暗示了一个教程或指南,旨在帮助用户识别并解决Windows XP中的错误问题。"HOW TO FIND AND FIX ERROR IN WINDOW 19"的描述可能是个笔误,...
Session Description: With the release of Nsight 5.5, a subset of the key GPU hardware metrics we have been using at NVIDIA to come up with driver-side and application-side optimizations are finally ...
j-jtp02244-Java.theory.and.practice-Fixing.the.Java.Memory.Model.Part1/2.pdf Java Memory Model Pragmatics (transcript).pdf 读JSR133笔记 - 十年磨一剑 - ITeye博客.pdf The JSR-133 Cookbook.pdf jsr-133-...
语言:English 此扩展名显示poe.trade中卖方的等级 此扩展是为了简化poe交易对旧数据的使用和价格固定,其开放源代码位于https://github.com/zohon/poe-trade-fixing