How to set Redis eviction policy (e.g. allkeys-lru) for WordPress app
-
Hey!
i’m using the WordPress app on Cloudron with the Redis Object Cache plugin.
i’ve allocated 4 GB RAM to Redis, but it keeps filling up over time because there’s no TTL on the keys. i’d rather use Redis’s built-in eviction instead of fixed expirations, like allkeys-lru or allkeys-lfu, so it automatically removes least-used or oldest keys when full.i couldn’t find any option for eviction policy in the Cloudron UI or documentation.
how can i set (or persist) maxmemory-policy allkeys-lru for the Redis instance that my WP app uses?
and where is the redis.conf file located for that instance (if it’s editable from the terminal)?thanks!
-
Hello @Miroo
Right now it is not possible to configure the Redis service manually that comes with apps.
The default setting for each redis service is:maxmemory-policy noevictionSee: https://git.cloudron.io/platform/redis-addon/-/blob/master/redis.conf
-
@Miroo you can set
define('WP_REDIS_MAXTTL', '900');in your wp-config.php . See https://github.com/rhubarbgroup/redis-cache/blob/main/README.md#configuration@joseph said in How to set Redis eviction policy (e.g. allkeys-lru) for WordPress app:
@Miroo you can set define('WP_REDIS_MAXTTL', '900'); in your wp-config.php . See
Thanks but It's less efficient than changing Redis's own eviction policies, as you can set it in a way that it would delete the less used ones instead of just a general expiration for all of them.
@james said in How to set Redis eviction policy (e.g. allkeys-lru) for WordPress app:
Right now it is not possible to configure the Redis service manually that comes with apps.
The default setting for each redis service is:Is it possible to get this settings in the future releases? it will be greatly appreciated!
-
That would indeed be useful.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login