I’m trying to configure Redis to be used as an LRU cache. According to this article we’ll need to set the following configuration options:
# Where 400mb is (just below?) the service's available memory maxmemory 400mb # Exact policy might be different per use case maxmemory-policy allkeys-lfu
I could fork http://github.com/render-examples/redis and change the configuration for my own needs. But I don’t want to hardcode the max memory variable as I want it to scale with whatever plan it’s on.
I believe Redis allows configuration to be set on runtime like this:
# Where 400 is dynamically generated based on available memory echo "CONFIG SET maxmemory 400" | redis-cli
I guess this could be part of the Dockerfile. But I’m not sure how.
Any advice on how to set this all up?