Resources and Best practices on redis setup

Resources

Reference on redis configuration in Magento’s local.xml file

http://inchoo.net/magento/using-redis-cache-backend-and-session-storage-in-magento/

and

http://devdocs.magento.com/guides/m1x/ce18-ee113/using_redis.html

Few important links from this Magento doc (link posted above) follow below:

1. Magento Expert Consulting Group (ECG) article about Redis:

https://info2.magento.com/rs/318-XBX-392/images/MagentoECG-UsingRedisasaCacheBackendinMagento.pdf

2. Redis session config:

https://github.com/colinmollenhour/Cm_RedisSession/blob/master/README.md

3. Redis back end config:

https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/blob/master/README.md

CCB module page

CCB module page in confluence (https://confluence.vaimo.com/display/CUSEXP/Vaimo_CacheCleanBuffer)

Best practices

Configure different <database> and <port> for each use of Redis

Configure different <database> and <port> for each use of Redis (session, fpc and cache) in local.xml (better performance as Redis is not multi thread)

Nevertheless at Vaimo we have so far standardised on only 2 Redis instances primarily, so we can configure the session store differently than the cache backend. In benchmarks we have seen so far, splitting FPC and Cache didn’t make much of a difference, but it might well be worth revisiting with our newer and bigger sites

Compression off for FPC only

Always turn compression off for FPC only (it has its own compression).

Turn persistent off

Always turn persistent off (because of bug with php-fpm)

Use a cronjob to keep Redis size healthy (garbage collection with rediscli.php)

Our Redis servers at Vaimo are configured to automatically expire old values and replace old keys, once a predefined memory limit it hit (limit is set bigger that what’s needed). Because of our server configuration, we have thus always felt that the cronjob is not necessary. Some recent projects have shown however that tag management can push up the latency to Redis, so potentially having fewer keys in those tags, at the expense of a slightly lower cache hit rate, could be beneficial to those projects. What is also potentially interesting is to see the cost of tag operations on empty tags (tags in redis for which all the keys have already expired). So this is all definitely worth investigating. 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s