https://www.yireo.com/tutorials/magento/magento-performance/1640-connecting-magento-with-redis-by-unix-socket
1. 在MAGENTO里面如何使用 REDIS
http://devdocs.magento.com/guides/m1x/ce18-ee113/using_redis.html
2. 使用unit socket 代替 自带的tcp连接方式
The main method of optimizing Magento is through caching, and the more efficient caching is handled, the faster Magento becomes. Using Redis as caching backend is a popular way of handling caching entries as efficiently as possible. This guide covers how to configure Magento for Redis using sockets, instead of a TCP/IP port.
Reconfiguring Redis to listen to a UNIX socket
To use a UNIX socket instead, open up the file /etc/redis.conf and locate the line mentioning unixsocket. Replace it with the following:
unixsocket /var/tmp/redis.sock
unixsocketperm 777
The location of the socket-file /var/tmp/redis.sock is a rather personal choice - it could be another location as well, but make sure it is not /tmp which would be insecure. Also note the permissions are set to 777 - this means that any user is able to read and write to the socket. We assumed this is not really bad because we' re dealing with a webserver anyway. If you wish to modify this to a more secure mode, make sure that the UNIX user that runs the webservice processes is able to read and write to the socket.
After modifying the Redis file, restart Redis itself:
service redis restart
If all goes well, Redis should be listening now to both through TCP/IP as through socket.
<cache> <backend>Cm_Cache_Backend_Redis</backend> <backend_options> <server>/var/tmp/redis.sock</server> <port>0</port> <database>0</database> <password></password> <force_standalone>0</force_standalone> <connect_retries>1</connect_retries> <automatic_cleaning_factor>0</automatic_cleaning_factor> <compress_data>1</compress_data> <compress_tags>1</compress_tags> <compress_threshold>20480</compress_threshold> <compression_lib>gzip</compression_lib> <persistent>0</persistent> </backend_options> </cache>
3. Redis session config
https://github.com/colinmollenhour/Cm_RedisSession/blob/master/README.md
4. Redis backend config
https://github.com/colinmollenhour/Cm_Cache_Backend_Redis/blob/master/README.md