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?
This commit is contained in:
Emi Matchu 2024-02-26 11:06:51 -08:00
parent 2e5b1c7350
commit 345a45ee0c

View file

@ -384,6 +384,14 @@
skip-bind-address skip-bind-address
notify: Restart MariaDB 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 - name: Create MySQL databases
community.mysql.mysql_db: community.mysql.mysql_db:
name: name: