Mariadb bin log eat my disk space - part2

Hi,

in some days my var/log/mysql eat all my disk space…

and i can’t acess to log files.

~# ee info

NGINX (1.10.3):

user                             www-data
worker_processes                 auto
worker_connections               4096
keepalive_timeout                30
fastcgi_read_timeout             300
client_max_body_size             100
allow                            127.0.0.1

PHP (5.6.33-1):

user
expose_php                       Off
memory_limit                     128M
post_max_size                    100M
upload_max_filesize              100M
max_execution_time               300

Information about www.conf
ping.path                        /ping
pm.status_path                   /status
process_manager                  ondemand
pm.max_requests                  500
pm.max_children                  100
pm.start_servers                 20
pm.min_spare_servers             10
pm.max_spare_servers             30
request_terminate_timeout        300
xdebug.profiler_enable_trigger   off
listen                           127.0.0.1:9000

Information about debug.conf
ping.path                        /ping
pm.status_path                   /status
process_manager                  ondemand
pm.max_requests                  500
pm.max_children                  100
pm.start_servers                 20
pm.min_spare_servers             10
pm.max_spare_servers             30
request_terminate_timeout        300
xdebug.profiler_enable_trigger   on
listen                           127.0.0.1:9001

MySQL (10.1.30-MariaDB) on localhost:

port                             3306
wait_timeout                     600
interactive_timeout              28800
max_used_connections             11
datadir                          /var/lib/mysql/
socket                           /var/run/mysqld/mysqld.sock
my.cnf [PATH]                    /etc/mysql/conf.d/my.cnf


~# df -h

Filesystem      Size  Used Avail Use% Mounted on
udev            5.8G     0  5.8G   0% /dev
tmpfs           1.2G   24M  1.2G   2% /run
**/dev/vda1     49G   38G   12G  77% /**
tmpfs           5.8G     0  5.8G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           5.8G     0  5.8G   0% /sys/fs/cgroup
tmpfs           1.2G     0  1.2G   0% /run/user/33
tmpfs           1.2G     0  1.2G   0% /run/user/0


~# du -h /var/log

27G     /var/log/mysql
328K    /var/log/clamav
868K    /var/log/redis
4.0K    /var/log/fsck
4.0K    /var/log/dist-upgrade
100K    /var/log/unattended-upgrades
4.0K    /var/log/puppetlabs/puppet
8.0K    /var/log/puppetlabs
920K    /var/log/letsencrypt
58M     /var/log/nginx
152K    /var/log/apt
20K     /var/log/php/5.6
792K    /var/log/php/7.0
816K    /var/log/php
828K    /var/log/ee
4.0K    /var/log/lxd
28G     /var/log

I try im my db, one purge, nothing…

Only have 3 wordpress sites, and only one ismore heavy (woocommerce).

Any help our sugestion.

Thanks

Hello,

you can purge mariadb binlog by running the command :

mysql -e "PURGE BINARY LOGS TO 'mariadb-bin.03';"

And to disable binlog (only if you don’t use replication) Comment the following lines in /etc/mysql/my.cnf :

log_bin                        = /var/log/mysql/mariadb-bin
expire_logs_days        = 10
max_binlog_size         = 100M

Then restart MySQL

Thanks

but after your istructions… nothing.

service mysql restart

~# df -h

Filesystem      Size  Used Avail Use% Mounted on
udev            5.8G     0  5.8G   0% /dev
tmpfs           1.2G   30M  1.2G   3% /run
**/dev/vda1        49G   38G   12G  78% /**

Any new sugestion?

Thanks

Go to /var/log/mysql and delete all files.

Any explanation why this happens? I have 1 site with woocommerce getting hardly any traffic and my 10gb disk fills up with binary log files in 2-3 days.

The binary log contains a record of all changes to the databases, both data and structure, as well as how long each statement took to execute. It consists of a set of binary log files and an index.

The purpose of the binary log is to allow replication, where data is sent from one or more masters to one or more slave servers based on the contents of the binary log, as well as assisting in backup operations.

Source : https://mariadb.com/kb/en/library/overview-of-the-binary-log/

It’s one website with no traffic. What changes are happening that could fill up 10gb every few days?

if it’s a woocommerce instance, there are probably enough changes in the database, launched in background with wp-cron.php to increase the binlog size. However, if you do not use db replication, you can disable binary log