Support » Plugin: Redis Object Cache » “OOM command not allowed when used memory > ‘maxmemory’.”

  • Resolved johnsyin97

    (@johnsyin97)


    Hi I am using free redis instance in heroku, has previously connecting to it without issue, when check on it today I see that it is not connected with this error. Following is copied from diagnostics tab:

    Status: Not connected
    Client: Predis (v1.1.8)
    Drop-in: Valid
    Disabled: No
    Ping: PONG
    Errors: [
        "OOM command not allowed when used memory > 'maxmemory'."
    ]
    PhpRedis: Not loaded
    Predis: 1.1.8
    Credis: Not loaded
    PHP Version: 7.4.25
    Plugin Version: 2.0.21
    Redis Version: 6.2.3
    Multisite: No
    Metrics: Disabled
    Metrics recorded: null
    Filesystem: Could not initialize filesystem.
    Global Prefix: "wp_"
    Blog Prefix: "wp_"
    WP_REDIS_DISABLED: false
    WP_REDIS_CLIENT: "predis"
    WP_REDIS_SCHEME: "redis"
    WP_REDIS_HOST: "<blablabla>.compute-1.amazonaws.com"
    WP_REDIS_PORT: 21029
    WP_REDIS_MAXTTL: 2419200
    WP_REDIS_PASSWORD: ••••••••
    Global Groups: [
        "blog-details",
        "blog-id-cache",
        "blog-lookup",
        "global-posts",
        "networks",
        "rss",
        "sites",
        "site-details",
        "site-lookup",
        "site-options",
        "site-transient",
        "users",
        "useremail",
        "userlogins",
        "usermeta",
        "user_meta",
        "userslugs",
        "redis-cache",
        "blog_meta"
    ]
    Ignored Groups: [
        "counts",
        "plugins",
        "themes",
        "blog-details",
        "blog-id-cache",
        "blog-lookup",
        "global-posts",
        "networks",
        "rss",
        "sites",
        "site-details",
        "site-lookup",
        "site-options",
        "site-transient",
        "users",
        "useremail",
        "userlogins",
        "usermeta",
        "user_meta",
        "userslugs",
        "redis-cache",
        "blog_meta"
    ]
    Unflushable Groups: []
    Drop-ins: [
        "Redis Object Cache Drop-In v2.0.21 by Till Krüss"
    ]
    • This topic was modified 2 months, 2 weeks ago by johnsyin97.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    You’re running out of Redis Memory. I’d strongly suggest setting a WP_REDIS_MAXTTL as well as an eviction policy:

    https://devcenter.heroku.com/articles/heroku-redis#maxmemory-policy

    Hi,

    Just wanted to say thanks for this topic and the advice.

    Although I don’t use Heroku as per the OP, I do use and recommend the free version of this plugin.

    I’ve just spent 2.5 hours trying to log into my WordPress site, successfully resetting the pw, etc, only still to find I was unable to log in, either the normal site or the Admin Dashboard. There were no errors displayed, no clue anything was up.

    Then it occurred to me to look at the error log for the site (d’oh), and it was full of errors reporting:

    AH01071: Got error 'PHP message: RedisException: OOM command not allowed when used memory > 'maxmemory'. in /home/mysite/public_html/dev/wp-content/object-cache.php

    I came here and found this topic. I found my Redis pool memory was full. I added the WP Redis TTL Config constant but it didn’t start to flush keys (older than a week).

    Then it dawned on me. A few months back I’d upgraded to Redis 6 and in setting it up, when I checked, I’d selected a Volatile-LFU policy, then forgot all about it. So it was only expiring keys with a volatile TTL, which it seems are er, none.

    After changing the redis.conf to maxmemory-policy allkeys-lru, restarting Redis, immediately Redis started flushing keys.

    Guess, what? I immediately was able to log in to my site!

    So hopefully this may help someone else who has exhausted all the usual reasons and causes.

    Thanks to @tillkruess and @johnsyin97 for the push in the right direction!

    • This reply was modified 1 month, 2 weeks ago by Graham Smith.
    Plugin Author Till Krüss

    (@tillkruess)

    Happy to hear it worked out! 🥰

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