Set Redis max memory policy#400
Conversation
|
|
||
| redis: | ||
| image: redis:alpine | ||
| command: ["redis-server", "--maxmemory", "4096MB", "--maxmemory-policy", "allkeys-lru"] |
There was a problem hiding this comment.
Ideally we'd set this in CI too, but GH Actions doesn't let you pass a custom command to a service.
There was a problem hiding this comment.
Yeah, that's fine. It wouldn't make a difference for our tests anyway.
brianhelba
left a comment
There was a problem hiding this comment.
I have concerns about how this will affect the use of Django Channels, which uses Redis to mediate websocket connections.
I think a better policy may be volatile-lru, but that might require cooperation from large_image. I'm happy to help investigate more.
|
|
#363 set our cache implementation to use However, we could:
|
|
I think |
I can't tell from how the redis docs are written if the eviction is anything that is past its TTL or anything that has a TTL at all. If the former, then the shortest possible TTL would permit tile to be evicted (but redis would normally keep them since it takes effort to evict things). If the latter, the a long TTL would prevent needless eviction. |
Resolves #398
This PR changes the command for the Redis container in development to the following:
For production, we can't set the max memory size of the Heroku Redis add-on without upgrading the plan (we currently use the mini plan), but we can set the max memory policy to
allkeys-lru.