Looking at:
https://redis.io/topics/lru-cache
recommends setting a specific amount max-memory.
Settingmaxmemory
to zero results into no memory limits. This is the default behavior for 64 bit systems, while 32 bit systems use an implicit memory limit of 3GB.When the specified amount of memory is reached, it is possible to select among different behaviors, called policies. Redis can just return errors for commands that could result in more memory being used, or it can evict some old data in order to return back to the specified limit every time new data is added.The exact behavior Redis follows when themaxmemory
limit is reached is configured using themaxmemory-policy
configuration directive.
How the eviction process works
It is important to understand that the eviction process works like this:
- A client runs a new command, resulting in more data added.
- Redis checks the memory usage, and if it is greater than the maxmemory limit , it evicts keys according to the policy.
I guess -- more to the point, is there a way to configure maxmemory
to, say 90% of the available system memory?
On Wed, May 30, 2018 at 11:26 AM, Stuart Reynolds
<stuart....@gmail.com> wrote:
> I'd like to configure redis as an LRU cache.
>
> Looking at:
> recommends setting a specific amount max-memory. However, really I'd prefer
> to to use all the available memory and apply the eviction policy when this
> fails (since the total host memory is a volatile thing in VM worlds and I
> don't want to configure redis each time I reconfigure host hardware).
>
> However, this seems to be in conflict with vm.overcommit_memory=1.
> which is recommended here: redis https://urldefense.proofpoint.com/v2/url?u=https-3A__redis.io_topics_admin&d=DwIBaQ&c=q3cDpHe1hF8lXU5EFjNM_A&r=N1Msa0ZexCqrdtWLgqlbMZlNrFKF4YmyP5otZCNJ7mmERCt9HPx5t646YC5_jvy8&m=xmLYpLHIJYHtVQ-zOKEH5dZpAHcnHzFj86ArJLcsVD0&s=IUvtw0C11c2hGaj4wqhAgrST8OhF6TbhdcRrXZgu7mk&e=
>
> Why is vm.overcommit_memory=1 recommended? It doesn't seem safe and would
> seem to prevent applying the eviction policy when out of system memory.
>
> - Stuart
>
> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to redis-db+unsubscribe@googlegroups.com.
> To post to this group, send email to redi...@googlegroups.com.
> Visit this group at https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_group_redis-2Ddb&d=DwIBaQ&c=q3cDpHe1hF8lXU5EFjNM_A&r=N1Msa0ZexCqrdtWLgqlbMZlNrFKF4YmyP5otZCNJ7mmERCt9HPx5t646YC5_jvy8&m=xmLYpLHIJYHtVQ-zOKEH5dZpAHcnHzFj86ArJLcsVD0&s=1gsZ83pwngVZBa0FE5oVPWb97BphUf84joRSRXY94To&e=.
> For more options, visit https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_optout&d=DwIBaQ&c=q3cDpHe1hF8lXU5EFjNM_A&r=N1Msa0ZexCqrdtWLgqlbMZlNrFKF4YmyP5otZCNJ7mmERCt9HPx5t646YC5_jvy8&m=xmLYpLHIJYHtVQ-zOKEH5dZpAHcnHzFj86ArJLcsVD0&s=rVDMKpJsmOkMusBcM9kGww-58GQx26v0wtJfPBtLPIE&e=.
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_group_redis-2Ddb&d=DwIBaQ&c=q3cDpHe1hF8lXU5EFjNM_A&r=N1Msa0ZexCqrdtWLgqlbMZlNrFKF4YmyP5otZCNJ7mmERCt9HPx5t646YC5_jvy8&m=xmLYpLHIJYHtVQ-zOKEH5dZpAHcnHzFj86ArJLcsVD0&s=1gsZ83pwngVZBa0FE5oVPWb97BphUf84joRSRXY94To&e=.
For more options, visit https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_optout&d=DwIBaQ&c=q3cDpHe1hF8lXU5EFjNM_A&r=N1Msa0ZexCqrdtWLgqlbMZlNrFKF4YmyP5otZCNJ7mmERCt9HPx5t646YC5_jvy8&m=xmLYpLHIJYHtVQ-zOKEH5dZpAHcnHzFj86ArJLcsVD0&s=rVDMKpJsmOkMusBcM9kGww-58GQx26v0wtJfPBtLPIE&e=.