Redis is better than APC and Memcached a lot because it support tags caching very good. Magento base on Zend Framework and Zend Framework caching work fastest with Redis more than APC and memcached so that if you can configure Redis for your magento then your magento site should faster a lot. If you don't know how to install Redis you can try this tutorial for Install Redis Server and PHP Redis on Ubuntu Server . It shouldn't different too much if you install on CentOS or other *Nux OS.
1. Install Redis. (2.4 is required because it supports operating on multiple keys for many operations)
2. Install phpredis. For 2.4 support you must use the “variadic” branch: git checkout -t -b variadic origin/variadic, phpredis is optional, but it is much faster than Redisent.
3. Install this module git://github.com/colinmollenhour/Zend_Cache_Backend_Redis.git
4. Edit app/etc/local.xml to configure
Based on this article we have turned off cache disk :
HTML Code:
<cache>
<backend>Zend_Cache_Backend_Redis</backend>
<slow_backend>database</slow_backend>
<slow_backend_store_data>0</slow_backend_store_data>
<auto_refresh_fast_cache>0</auto_refresh_fast_cache>
<backend_options>
<server>127.0.0.1</server>
<port>6379</port>
<database>database</database>
<use_redisent>0</use_redisent> <!-- 0 for phpredis, 1 for redisent -->
<automatic_cleaning_factor>20000</automatic_cleaning_factor> <!-- optional, 20000 is the default, 0 disables auto clean -->
</backend_options>
</cache>
To check if everything works fine you can use redis-cli :
Code:
flexishore@virtualbox:~$ redis-cli
redis 120.0.01:6379> select database
OK
redis 127.0.0.1:6379> keys *
1) "zc:d:97a_REC_0000000510"
2) "zc:d:97a_REC_0000000511"
3) "zc:d:97a_REC_0000001240"
4) "zc:d:97a_REC_0000000512"
.......
As you can see, there are a lot of cache indexes in Redis database.
Source code : link
Benchmark class : benchmark.php
View more threads in the same category:
Bookmarks