• So our database grew so large that it became unresponsive. We couldn’t clean up the tables via the plugin settings nor manually using SSH.

    I have finally been able to truncate the wp_adrotate_tracker table and make the site/database responsive again. My worry is that this might grow huge and cause problems again.

    After 10 or so minutes of the ads being turned on again the wp_adrotate_tracker table now has 100 rows. Estimating from this, after a day it would be around 14k rows. A few days worth of data would definitely make this table large again.

    I’ve read a previous thread regarding the adrotate_clean_trackerdata() function not being called. I’m thinking maybe this is also the case with ours. Perhaps the wp_next_scheduled being called isn’t triggering a cronjob?

    The best thing I can think of is to create a custom plugin that uses transients to call adrotate_clean_trackerdata() every 30 minutes to ensure that the table remains small. Would calling that function that fast be advisable? I did not dig too deep into the code to know whether stats gathering would be affected by adrotate_clean_trackerdata(), but logically it shouldn’t

    https://www.ads-software.com/plugins/adrotate/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Benjamin Intal

    (@bfintal)

    Here’s the code, changed it to every 15 minutes:

    add_action( 'wp_head', 'gambit_adrotator_fix' );
    
    function gambit_adrotator_fix() {
    	$fixTrans = get_transient( 'gambit_adrotator_fix_trans' );
    	if ( empty( $fixTrans ) ) {
    		if ( function_exists( 'adrotate_clean_trackerdata' ) ) {
    			adrotate_clean_trackerdata();
    		}
    		set_transient( 'gambit_adrotator_fix_trans', '1', HOUR_IN_SECONDS / 4 );
    	}
    }
    Plugin Author Arnan de Gans

    (@adegans)

    If the cronjob is being triggered you can re-activate the plugin to re-instate the schedules for that.
    You can see if the schedules are active in AdRotate settings, near the bottom of the page.

    If the schedule is not active because of the bug mentioned in that thread, then obviously you need to update your AdRotate installation to the newer version that fixes the issue.

    Your “solution” will run a cleanup (or check for it) on every pageload which, if your site is busy, may overload your server worse than not cleaning the table at all.

    ps – adrotator is another plugin ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘MySQL crashed because of wp_adrotate_tracker’ is closed to new replies.