From 345a45ee0c8513e87a6527eff15feadf73a57a6a Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Mon, 26 Feb 2024 11:06:51 -0800 Subject: [PATCH] Add slow query logging to MariaDB config The database did a weird thing today, where it wouldn't even respond to the usual stop signal, I had to fully `kill -9` it?? I didn't see anything in the logs indicating what it was busy doing, and people online seem to describe having this problem sometimes but with no obvious solution. For now, I'll try turning on the slow query logger, to see if that might give us hints about whether there was like a denial-of-service query attack hitting us or something? --- deploy/setup.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/deploy/setup.yml b/deploy/setup.yml index 4a573042..a6d2caa1 100644 --- a/deploy/setup.yml +++ b/deploy/setup.yml @@ -384,6 +384,14 @@ skip-bind-address notify: Restart MariaDB + - name: Enable slow query logging for MariaDB + copy: + dest: /etc/mysql/mariadb.conf.d/80-logging.cnf + content: | + [mysqld] + slow-query-log + notify: Restart MariaDB + - name: Create MySQL databases community.mysql.mysql_db: name: