My WordPress website uses Nginx. Recently I have noticed that server volume has increased from 8GB to 40GB. I have found that the WordPress MYSQL Binary Log is taking more space. Each second, database transactions are written to the Binlog files.
I am wondering that we do not have massive traffic on our website/WordPress. And having so many and large MySQL binlog files, as well as a lot of database events that are logged in the binlog files per second, could cause by a bot attack or any plugins are heavily using the database for temporal storage.
What I have done so far, I ran mysql> PURGE BINARY LOGS BEFORE '2021-08-30 22:46:26'. This reduces disk size from 40GB to 10GB which is good.
My question: (1) Since I use a single server and I am not using a replica, can I disable BINARY LOG (mysql> SET SQL_LOG_BIN =0), if I disable BINARY LOG, will this cause an issue?
(2) What causes binary log files to increase raipdaly, could this be malicious traffic? if so how can I stop it?
Any thought?
Set
expire_logs_days
orbinlog_expire_logs_seconds
so that the binlogs will be automatically (periodically) purged.Binlogs are used for replication and/or certain types of backup. Since you don't seem to do either, yes, change to
log_bin = OFF
. Note: executingSET
will not persist past the next restart. You must change the config file (perhapsmy.cnf
).Why so rapidly growing? That's hard to say without looking in the binlog to see what bulky or repeated or naughty things are there.
DBA type questions would be better directed to dba.stackexchange.com
If the file has one or more "include", follow them to the files there. For example:
That directory will contain 0 or more continuations of the config. Consider adding a new file with your name as the file name and contents like
It may actually be better to name the file starting with
z
so that it will be (alphabetically) handled last.