简体   繁体   English

MySQL每30分钟冻结40秒

[英]MySQL freezing for 40 seconds every 30 minutes

We are running MySQL 5.6 on Windows Server 2008r2. 我们在Windows Server 2008r2上运行MySQL 5.6。

Every 30 minutes it runs very slowly for around 40 seconds and then goes back to normal for another 30 minutes. 它每30分钟运行一次非常缓慢约40秒,然后再恢复正常30分钟。 It is happening like clockwork with each 'hang' being 30 minutes after the last one finished. 这种情况就像发条一样,每次“挂起”都是在最后一次完成后30分钟。

Any ideas? 有任何想法吗? We are stumped and don't know where next to look. 我们很难过,不知道接下来要去哪儿。

Background / things we have ruled out below. 背景/我们在下面排除的事情。

Thanks. 谢谢。

• Our initial thoughts were a locking query but we have eliminated this. •我们最初的想法是锁定查询,但我们已经消除了这一点。

• The slow query log shows affected queries but with zero lock time. •慢查询日志显示受影响的查询,但锁定时间为零。

• General logs show nothing (as an aside, is there a way to increase the logging level to get it to log when it is flushing the cache etc? What does MySQL run every 30 minutes?) •常规日志没有显示任何内容(顺便说一句,是否有办法提高日志记录级别以便在刷新缓存等时进行日志记录?MySQL每30分钟运行一次?)

• When it is running slowly, it is still running but even simple queries like Select 'Hello World'; •当它运行缓慢时,它仍然在运行,但即使是简单的查询,例如Select'Hello World'; take over a second to run. 接过一秒钟跑。

• All MySQL operations run slowly at the time in question including monitoring tools and especially making new connections. •所有MySQL操作在所讨论的时间运行缓慢,包括监视工具,尤其是建立新连接。 InnoDB and MyISAM are equally affected. InnoDB和MyISAM同样受到影响。

• We have switched from using the SAN array to using local SSD and it has made no difference ruling out disk / spindles. •我们已经从使用SAN阵列切换到使用本地SSD,并且没有任何区别排除磁盘/主轴。

• The machine has Sophos Endpoint Protection but this is not scanning anything on the database drives. •本机具有Sophos Endpoint Protection,但这不扫描数据库驱动器上的任何内容。

• It is as if the machine is maxed out but local performance monitoring does show any unusual system metrics. •就好像机器已达到最大值,但本地性能监控确实显示任何异常的系统指标。 CPU, disk queue, disk throughput, memory, network activity etc. are all flat. CPU,磁盘队列,磁盘吞吐量,内存,网络活动等都是平的。

• The machine is a VM running on VMware. •计算机是在VMware上运行的VM。 Hypervisor monitoring is not showing any performance issues – but I am not convinced it is granular enough to pick up a 30 second spike. 管理程序监控没有显示任何性能问题 - 但我不相信它足够精细,可以获得30秒的峰值。

• We have tried adjusting MySQL settings like the InnoDB cache size, log size etc and this has made no difference. •我们已经尝试调整MySQL设置,如InnoDB缓存大小,日志大小等,这没有任何区别。

• The server runs nothing other than a couple of MySQL instances. •除了几个MySQL实例之外,服务器只运行。

• The other instances are unaffected - as far as we can tell. •据我们所知,其他情况不受影响。

There's some decent advice here on Server Fault: 在服务器故障上有一些不错的建议:

https://serverfault.com/questions/733590/mysql-stops-responding-periodically https://serverfault.com/questions/733590/mysql-stops-responding-periodically

Have you monitored Disk I/O? 您是否监控过磁盘I / O? Is there an increase in I/O wait times or queued transactions? I / O等待时间或排队事务是否有所增加? It's possible that requests are queueing up at the storage level due to an I/O limitation put on by your host. 由于主机的I / O限制,请求可能在存储级别排队。 Also, have you checked if you're hitting your max allowable mysql clients? 另外,你有没有检查过你是否达到了最大允许的mysql客户端? If these queries are suddenly taking a lot longer to complete, it's also possible that it's not leaving enough available connections for normal site traffic because the other connections aren't closing fast enough. 如果这些查询突然花了很长时间才能完成,那么它也可能没有为正常的站点流量留下足够的可用连接,因为其他连接的关闭速度不够快。

I'd recommend using IOSTAT and seeing if you're saturating your disks. 我建议使用IOSTAT,看看你是否让你的磁盘饱和。 It should show if all your disks are at 100% usage, etc. 它应该显示所有磁盘是否都是100%使用率等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM