sys_messages table keeps crashing when cron runs

if ( $db_clean_msg > 0 ) {
            $res = db_res("DELETE FROM `sys_messages` WHERE `Date` < NOW() - INTERVAL $db_clean_msg DAY");
            if ( $res ) {
                $db_clean_msg_num = db_affected_rows();
                db_res("OPTIMIZE TABLE `sys_messages`");
            }
        }

 

I am wondering if the Optimize Table is causing this?

Geeks, making the world a better place
Quote · 19 Feb 2019

Any database people here?

Geeks, making the world a better place
Quote · 23 Feb 2019

Less likely OPTIMIZE TABLE cause table crashing, however you can comment out this line to see if this helps.

Rules → http://www.boonex.com/terms
Quote · 26 Feb 2019

I have searched the net and looked at the server.  The error log reports nothing but the crashed table.  My config is:

 

query_cache_type = 1
query_cache_limit = 2M
query_cache_size = 200M
key_buffer_size = 64M
max_heap_table_size = 512M
tmp_table_size = 512M
thread_cache = 128
open_files_limit = 4096

Geeks, making the world a better place
Quote · 26 Feb 2019

Did you try to check mysql error log ?

Rules → http://www.boonex.com/terms
Quote · 26 Feb 2019

 

Did you try to check mysql error log ?

Yes, of course.  The error log shows no errors reported until it reports the table is crashed. It is definitely crashing at cron job run, every night.  I would suspect the drive but it only crashes when the cron job runs.  It is not crashing during the day with active members on the site sending messages.  I may export the table, drop it, then import the table and see what happens.

Geeks, making the world a better place
Quote · 26 Feb 2019
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.