O'Reilly logo

Instant Redis Persistence by Matt Palmer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Limiting cache memory (Intermediate)

The cache we discussed in the first recipe has a problem—as more and more data gets added to your Redis instance, it will gradually consume more memory. You will typically want to limit the amount of memory your cache consumes so it won't overwhelm your server.

This is most clearly a problem on servers where Redis is sharing space with other services, such as a web server or database. If any service doesn't have enough memory to work in, nobody will have a good time. However, it is also a problem for machines where Redis is the only service of interest. Redis doesn't perform well when any of its memory space is swapped out, and if you don't want to have hard-to-explain performance problems with your Redis, you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required