MySQL query is slow and causes server to stop

We have a MySQL server on RDS, version 5.6.34.R1 with innodb.

Our traffic is quite moderate, it fluctuates between 100-300 KB / s.

Ours selects per second

hovers around 30 and can sometimes rise to 120.

All our tables are correctly indexed and according to the server state in MySQL Workbench the key efficiency is 100%.


The server itself is on M4.4xLarge.

However, if it is smaller than M4.4xLarge, during a small spike in traffic (which should be acceptable even for M4 Medium) a single query is run that joins maybe 3 or 4 tables and it lags behind and takes a couple of minutes and then everything starts to fail.

  • More and more requests start coming in but fail to complete.

  • The number of connections increases significantly (300+), reaching the "maximum number of connections".

  • The CPU and RAM utilization of the database server increases significantly.

  • Killing all connections only delays the inevitable by a couple of seconds; they come back.

This is with 0 entry and only SELECT.

I'm not sure what to do. Is there some configuration I should be looking at? With some sort of traffic, M4 Medium should really be able to handle it and more.


Update:

I have set slow_query_log threshhold to 2 seconds.

I reduced the instance to m4.xlarge; we will see how long it will collapse.

Once I get the list of slow requests, I'll post them here.

+3


source to share





All Articles