• Resolved sevatt

    (@sevatt)


    We recently had a scaling issue with class.photocrati_transient_manager.php.

    We use Memcached and have 2000+ blogs. In this configuration, the function _update_tracker() is getting called on every page view. This causes the option ‘phtocrati_cache_tracker’ to be deleted and recreated on every page view. Most of the time, the value is an empty array(). This behavior is causing massive contention with our database.

    Due to the frequency this routine is called for users with memcached, it would be best to verify the value has changed before issuing two writes to the database.

    Normally, I’d do a pull request.

    We have modified the function to look like:

    class.photocrati_transient_manager.php: line 45.

    ## The following function was patched on 2018-04-20.
    ## At issue, the function did an option delete / option add for every page
    ## view.  This update fixes the function so it only updates the option in
    ## the DB when the value has been modified (very rare).  -- sevatt.
    
    function _update_tracker()
    {
            global $_wp_using_ext_object_cache;
            if ($_wp_using_ext_object_cache) {
                    $current_value = get_option('photocrati_cache_tracker', array() );
                    if ($current_value !== $this->_tracker) {
                            #delete_option('photocrati_cache_tracker');
                            #add_option('photocrati_cache_tracker', $this->_tracker, '', 'no');
                            #for WP >= 4.2 you can do this instead
                            update_option('photocrati_cache_tracker', $this->_tracker, 'no');
                    }
            }
    }
    • This topic was modified 8 years, 1 month ago by sevatt.
    • This topic was modified 8 years, 1 month ago by sevatt.
    • This topic was modified 8 years, 1 month ago by sevatt.
Viewing 1 replies (of 1 total)
  • Plugin Contributor Imagely

    (@imagely)

    @sevatt – Thanks for the feedback and idea, please send us a Bug Report (https://imagely.com/report-bug/ … please reference this topic) so we can get a better look under the page at your site and review this more in-depth with you.

    Please include as many details as you can about your sites(?) and the issue at hand so we can move on this as fast as possible.

    Thanks!

    – Cais.

Viewing 1 replies (of 1 total)

The topic ‘Scale issue with class.phtocrati_transient_manager.php’ is closed to new replies.