• Resolved net

    (@krstarica)


    After upgrading Yoast SEO from 22.0 to to 22.1 started seeing dozens of “Predis\Connection\ConnectionException: Error while reading line from the server” errors every 15-20 minutes:

    [23-Feb-2024 19:04:47 UTC] Predis\Connection\ConnectionException: Error while reading line from the server. [unix:/var/run/redis/redis.sock] in /home/wordpress/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/AbstractConnection.php:131
    Stack trace:
    #0 /home/wordpress/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/StreamConnection.php(286): Predis\Connection\AbstractConnection->onConnectionError()
    #1 /home/wordpress/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/AbstractConnection.php(119): Predis\Connection\StreamConnection->read()
    #2 /home/wordpress/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/AbstractConnection.php(111): Predis\Connection\AbstractConnection->readResponse()
    #3 /home/wordpress/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Connection/StreamConnection.php(232): Predis\Connection\AbstractConnection->executeCommand()
    #4 /home/wordpress/wp-content/plugins/redis-cache/dependencies/predis/predis/src/Client.php(225): Predis\Connection\StreamConnection->connect()
    #5 /home/wordpress/wp-content/object-cache.php(924): Predis\Client->connect()
    #6 /home/wordpress/wp-content/object-cache.php(546): WP_Object_Cache->connect_using_predis()
    #7 /home/wordpress/wp-content/object-cache.php(256): WP_Object_Cache->__construct()
    #8 /home/wordpress/wp-includes/load.php(856): wp_cache_init()
    #9 /home/wordpress/wp-settings.php(131): wp_start_object_cache()
    #10 /home/wordpress/wp-config.php(128): require_once('...')
    #11 /home/wordpress/wp-load.php(50): require_once('...')
    #12 /home/wordpress/wp-blog-header.php(13): require_once('...')
    #13 /home/wordpress/index.php(17): require('...')
    #14 {main}

    Ref: https://wordpress.org/support/topic/predisconnectionconnectionexception-errors-in-22-1/

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

    (@tillkruess)

    There isn’t anything we can do about it on our end, they gotta fix their code.

    Thread Starter net

    (@krstarica)

    This does seem related to this plugin and the number of errors is even worst 🙁

    Unfortunately introducing WP_REDIS_FLUSH_TIMEOUT didn’t help as explained in my comment.

    Plugin Author Till Krüss

    (@tillkruess)

    How large is your Redis database?

    Thread Starter net

    (@krstarica)

    /etc/redis/redis.conf:

    maxmemory 1536mb
    maxmemory-policy allkeys-lfu
    save ""
    unixsocket /var/run/redis/redis.sock
    Plugin Author Till Krüss

    (@tillkruess)

    What does redis-cli dbsize show?

    Thread Starter net

    (@krstarica)

    (integer) 2145890

    Plugin Author Till Krüss

    (@tillkruess)

    Got it. That’s relatively large 2.1M keys in Redis. I’m guessing the Redis Server hangs when Yoast is flushing cache groups.

    Are you comfortable with making code changes for us to try a solution?

    Thread Starter net

    (@krstarica)

    Of course, please let me know what to do.

    Thread Starter net

    (@krstarica)

    Found that after running the redis-cli flushall command, identical errors occur.

    As noticed in the other topic, commenting out wp_cache_flush_group( 'orphaned_counts' ) “fixes” things.

    Does this actually mean that maxmemory 1536mb we are using is too high?

    Plugin Author Till Krüss

    (@tillkruess)

    @net, no it means that your Redis Server process is taking too long to scan all keys and flush the group. We’ll include an alternative group flush mechanism in the next release.

    Plugin Author Till Krüss

    (@tillkruess)

    The next version of Redis Object Cache will support WP_REDIS_DISABLE_GROUP_FLUSH to disable group flushing for very large datasets. Until that’s released you can try using WP_REDIS_FLUSH_TIMEOUT and set it to a very high value to avoid timeouts.

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