Is there any way to stop MYSQL Delayed Inserts from MySQL configuration?

I am stuck with a strange problem with one of our servers. I see there are delayed mysql inserts

+--------+----------------+-----------+------------------+----------------+------+--------------------+------------------------------------------------------------------------------------------------------+ | Id | User | Host | db | Command | Time | State | Info | +--------+----------------+-----------+------------------+----------------+------+--------------------+------------------------------------------------------------------------------------------------------+ | 219586 | DELAYED | localhost | XXXX | Delayed insert | 202 | Waiting for INSERT | | 

in rarely used databases. From what I understood from the MySQL manual, these inserts are waiting for others to optimize highly used databases for writing inserts in packages / blocks. Unfortunately, they say that this method consumes a lot of memory and is extremely inefficient when used in rarely used databases. In this particular case, the database receives only 10-20 queries per day, which makes delays extremely large - up to a whole day. Similar problems arise with other databases / users, and when added they seem to load the use of MySQL memory and CPU.

Is there a way to prevent delayed pending requests? How to make em act like regular requests?

Thanks in advance!

Cheers, Venetsian.

+4
source share
2 answers
  • You can FLUSH TABLES or "KILL 219586" to get this thread to complete its task and exit
  • Set max_delayed_threads=0 in the configuration file and restart the instance to completely disable the DELAYED function.
  • Read the documents - it will be faster than waiting 6h in the forum
+5
source

Do not worry about this topic. It is simply stored in case a pending insertion appears in the future. It actually does nothing ..

+2
source

All Articles