• Resolved Vanderlindemedia

    (@jvanderlinde)


    Hi,

    An update struck one of my servers for some reason killing the Redis instance, or at least, it’s a nasty bug where some redis instances simply do no longer work that are within CageFS it seems. We’re actively trying to resolve this with Cloudlinux. It seems a update from RHEL caused issues with the above.

    But – this caused approx 15+ websites to crash – due to non existing Redis service not being available, and the websites that where running litespeed Caching and using object cache still proceeded to work (just without redis). It means that for whatever reason Redis is not available, the site simply won’t start using this plugin.

    I would suggest a fail-safe fallback, because i had to plunge into hundreds of sites to learn i had approx 15 running with above plugin that failed to start.

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

    (@tillkruess)

    The object cache in WordPress must be online at all times, just like SQL. Otherwise the cache data will go stale and will cause data loss.

    Thread Starter Vanderlindemedia

    (@jvanderlinde)

    Yes,

    In a fortunate update, that either happened through Directadmin or REL through Cloudlinux, Redis instance got nuked from multiple to a single one, making every website that used to run Redis crash that where using the Redis Object Cache plugin. Sites with Litespeed only did not crash – thus making it still operate but without the use of Redis.

    I would suggest there is a fallback once the Redis is no longer available (for whatever reason).

    Plugin Author Till Krüss

    (@tillkruess)

    No, Litespeed is vulnerable to data corrupting.

    I suggest you set up supervisord and monitoring service to keep an eye on your infrastructure if it’s that critical.

    Thread Starter Vanderlindemedia

    (@jvanderlinde)

    Well, at least it works,

    And it won’t crash the complete website after Redis seems to fail.

    So i assume your not taking this bug request then.

    I m agree.

    Why do you not include this code below to your start file “object-cache.php” ?

    That will be simple and secure.

    Thanks.

    if (!defined('WP_REDIS_DISABLED')) {

        if (!class_exists('Redis')) {

            define('WP_REDIS_DISABLED', true); // PHPRedis extension not installed

        } else {

            try {

                $redis = new Redis();

                $redis->connect('127.0.0.1', 6379, 1); // 1s timeout

                if (!$redis->ping()) {

                    define('WP_REDIS_DISABLED', true); // Redis server not responding

                }

                $redis->close();

            } catch (Exception $e) {

                define('WP_REDIS_DISABLED', true); // Redis connection failed

            }

        }

    }
    • This reply was modified 7 months, 1 week ago by WebMat.

    @jvanderlinde What was your solution with cage FS, cPanel and this plugin? Having the same issue every few days the redis server now crashes and making core dump files which stop the restart from happening.

    It would be good if this plugin didn’t crash every site when redis isn’t available. A simple GUI warning would suffice or similar.

    Thread Starter Vanderlindemedia

    (@jvanderlinde)

    De-install and used Object Cache that came through Litespeed.

    The good news is that whenever Redis is no longer available, the site won’t stall, crash, it will still continue to operate. It caches whatever you insert into it. No need for a fancy plugin for virtually the same.

    The bad news? I can’t think of one really. It all comes in one package through Litespeed.

    I figured i get identical speed results for the smaller websites i’m running by using a combination of Memcached and Opcache. Object cache in general should only be used when that database is large in the millions of rows.

    Plugin Author Till Krüss

    (@tillkruess)

    @devappau Regardless of the plugin you use, you should use supervisord to ensure the Redis process restarts when an error occurs. Make sure to set the maxmemory-policy in your redis.conf so that Redis doesn’t go OOM when it reaches its memory limit.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Serious Redis Object Cache Bug’ is closed to new replies.