OPTIMIZE TABLE causing DB problems
Posted: Thu May 19, 2016 4:13 pm
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?
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