Page 1 of 1

MySQL Backup Size/Disable MySQL Backups

Posted: Tue Feb 18, 2025 9:02 am
by wneville
Hello,

Recently the daily mysql backups have gotten extremely large and I am not sure how to resolve it other than to disable them. Is that safe to do if I am running a daily local backup within NagiosXI? My most recent daily mysql backup is over 4GB and with this happening daily I can't allow it to continue. This hasn't been an issue until recently so not sure what happened.

I also noticed that /var/data/mysql has grown quite a bit. Is there any way to decrease the amount of space these files are using?:

Code: Select all

mysql]# pwd
/var/data/mysql

mysql]# du -all --human-readable --one-file-system --max-depth=4 | sort -k1 -rh |  head -n 20
25G     .
14G     ./nagios
11G     ./nagiosxi
9.9G    ./nagiosxi/xi_meta.ibd
5.4G    ./nagios/nagios_eventhandlers.MYD
2.9G    ./nagios/nagios_statehistory.MYD
2.4G    ./nagios/nagios_logentries.MYD
976M    ./nagios/nagios_logentries.MYI

Any help is appreciated. I would also love to know the root cause for the sudden increase in the size of the mysql backups but priority right now is shutting them off if that is safe to do. The Database Maintenance light in the System Status dashlet is red but I have run the repair_databases.sh script a few times now and it always completes very quickly.

I am running NagiosXI 2024R1.3.3 on RHEL 8

Thank you!

Re: MySQL Backup Size/Disable MySQL Backups

Posted: Wed Feb 19, 2025 5:52 pm
by jmichaelson
Database backup size is naturally a function of the size of the database. The MySQL databases use mysqldump for the backup. which produces a lot of redundant text text; you've got nearly 10GB in xi_meta.ibd, and 11.6 GB in the nagios directory. 4GB doesn't seem unreasonable for a backup of that much data.

My initial suspicion is that you've got a database maintenance job that isn't running correctly to clean these up.

Re: MySQL Backup Size/Disable MySQL Backups

Posted: Thu Feb 20, 2025 4:14 pm
by wneville
Are there recommended steps outside of running the repair_databases.sh script?