8181264 system user <Nagios Server 1> Connect 1861 altering table OPTIMIZE TABLE nagios_logentries 0 0
8210730 ndoutils 10.176.30.7:53778 <Nagios Server 2> Query 58 Waiting for table metadata lock INSERT INTO nagios_logentries SET instance_id
='1', logentry_time=FROM_UNIXTIME(1463661910), entry_ti 0 0
8211099 ndoutils 10.176.30.7:35863 <Nagios Server 2> Query 64 altering table OPTIMIZE TABLE nagios_logentries 0 0
8211132 ndoutils 10.176.30.7:54833 <Nagios Server 2> Query 64 Waiting for table metadata lock OPTIMIZE TABLE nagios_logentries 0 -0
OPTIMIZE TABLE causing DB problems
OPTIMIZE TABLE causing DB problems
Our DBA Team have identified dead locks happened with the nagios_logentries table and it appears that the OPTIMIZE Table is the cause. Can you provide more detail how often the Nagios software is calling optimize tables? Is this part of a script or a certain mechanic? If so is there any way to turn it off?
Re: OPTIMIZE TABLE causing DB problems
This can happen when the nagios_logentries tables gets really large, you can adjust how often it optimizes under Admin > Performance Settings > Databases > Optimize Interval.
You should also look at adjusting the Max Log Entries Age setting on that page.
You should also look at adjusting the Max Log Entries Age setting on that page.
Re: OPTIMIZE TABLE causing DB problems
Also, check the size of it:
Code: Select all
echo "SELECT table_name AS table_name, round(((data_length + index_length) / 1024 / 1024), 2) Size_in_MB FROM information_schema.TABLES WHERE table_schema = 'nagios' AND table_name = 'nagios_logentries';" | mysql -uroot -pnagiosxiRe: OPTIMIZE TABLE causing DB problems
Will the "Performance Settings" work if the Database is offloaded and Nagios XI is used a VIP/Load Balancer to the databases?
Re: OPTIMIZE TABLE causing DB problems
Additionally, Would the value of 0 mean it does not run or does it mean ever minute? If I wanted to disable it completely and let MySQL do it on it own, how would I do that?
Re: OPTIMIZE TABLE causing DB problems
Yeschicjo01 wrote:Will the "Performance Settings" work if the Database is offloaded and Nagios XI is used a VIP/Load Balancer to the databases?
Also, setting the optimize interval to 0 will disable the optimization.
Re: OPTIMIZE TABLE causing DB problems
Thank you for the information.
Re: OPTIMIZE TABLE causing DB problems
This issue can be closed.
Re: OPTIMIZE TABLE causing DB problems
Locking this up!
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/