Support » Plugin: Redis Object Cache » Problem with the cron

  • Resolved henrikviggers

    (@henrikviggers)


    Hello,

    First of all, thank you for an excellent plugin.

    Secondly, I’d like to ask about an issue encountered with the cron.

    After activation of the plugin the WP debug.log is now being flooded with following errors: Cron unschedule event error for hook: [various hooks], Error code: could_not_set, Error message: The cron event list could not be saved.

    In the thread https://wordpress.org/support/topic/cron-unschedule-event-error-for-hook/page/9/ I found a following comment:

    I had this problem again on my site and noticed that the cron in alloptions stored in the object cache was different than the cron in wp_options in the database.
    These values are set by functions such as update_option, but since exclusive control is not performed, if multiple processes/threads (not limited to concurrent cron) set the values at the same time, different values may set.
    update_option has a check that does not update unless the value changes, but this check is based on the object cache. Therefore, the same value as in the database bypasses the check, resulting in 0 updates where previously reported. So I added the following code to the theme’s functions.php and the error disappeared.
    wp_cache_delete( ‘alloptions’, ‘options’ );
    Performance will be affected, but I will see how it goes in this state for now.

    Could you kindly advise on this issue?

    Best regards,
    Henrik

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    Have you tried flushing the Redis cache?

    Thread Starter henrikviggers

    (@henrikviggers)

    Thanks for a prompt reply.

    Yes, I have also tried flushing the Redis cache, unfortunately this didn’t resolve the issue. I am still getting the “Cron unschedule event error for hook: [various hooks], Error code: could_not_set, Error message: The cron event list could not be saved., Data: {“schedule”:false,”args”:[]}”.

    Plugin Author Till Krüss

    (@tillkruess)

    When you disable Redis Object Cache, does the error happen as well?

    Thread Starter henrikviggers

    (@henrikviggers)

    No, when the plugin is disabled these cron related errors go away.

    We have been further analyzing possible issues and was able to maybe connect the cron issues with the PHP memory exhausted errors. Although the Redis server itself has no memory limit and we have a dedicated server with 32 GB RAM, there were situations when the object-cache.php would cause PHP memory limit exhaustion (which is set to 256M, i.e. quite large). Before enabling the plugin we never had PHP memory limit exhaustions.

    The website is not light weight, however average memory usage per session was below 50M. After the plugin has been activated there were situations when PHP memory limit of 256M was exceeded by the object-cache.php, e.g. PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 90112 bytes) in /…/object-cache.php on line 2457

    This resulted in issues with the service for the users, so we had to disable it and the PHP memory issues ceased since then.

    Could you kindly advise on the object-cache.php PHP memory overhead?

    I will appreciate any recommendations.

    Plugin Author Till Krüss

    (@tillkruess)

    If your site is heavy weight, try increasing the PHP memory limit to 512 and 1024 to see if that resolves the cron errors.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.