Configure Redis Server in Ubuntu – Caching Server For Magento

Redis – Server :-
REDIS is an open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. Redis works with an in-memory dataset.

Redis-Server Installation on Ubuntu:

Execute below commands in /tmp directory.
-> wget http://download.redis.io/redis-stable.tar.gz
-> tar xvzf redis-stable.tar.gz
-> cd redis-stable
-> make

First Install Redis Cache Extension:
-> git clone https://github.com/colinmollenhour/Cm_Cache_Backend_Redis.git
-> mv Cm_Cache_Backend_Redis/Cm app/code/community
-> rm -rf Cm_Cache_Backend_Redis

Then Install Redis Session Extension:
-> git clone https://github.com/colinmollenhour/credis.git
-> mv credis lib/Credis
-> git clone https://github.com/colinmollenhour/Cm_RedisSession.git
-> mv Cm_RedisSession/code/ app/code/community/Cm/RedisSession
-> mv Cm_RedisSession/Cm_RedisSession.xml app/etc/modules/Cm_RedisSession.xml
-> rm -rf Cm_RedisSession

Just after <global> add, change persistent and db to suit.
Add below lines in app/etc/local.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<cache>
<backend>Cm_Cache_Backend_Redis</backend>
<backend_options>
<server>redis11.i</server>
<port>6379</port>
<persistent>cache-db0</persistent>
<database>0</database>
<password></password>
<force_standalone>0</force_standalone>
<connect_retries>1</connect_retries>
<read_timeout>10</read_timeout>
<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>
</backend_options>
</cache>
 
<session_save>db</session_save>
<redis_session>
<host>redis1.i</host>
<port>6379</port>
<timeout>2.5</timeout>
<persistent>sess-db1</persistent>
<db>1</db>
<compression_threshold>2048</compression_threshold>
<compression_lib>lzf</compression_lib>
<log_broken_locks>0</log_broken_locks>
<max_concurrency>10</max_concurrency>
<break_after_frontend>5</break_after_frontend>
<break_after_adminhtml>30</break_after_adminhtml>
<bot_lifetime>7200</bot_lifetime>
</redis_session>

Check whether Redis-Server is correctly configured.
Execute the following commands in ssh.

root@ip:~# redis-cli (Enter)
redis 127.0.0.1:6379> KEYS *

1) “zc:ti:mage_LAYOUT_GENERAL_CACHE_TAG”
2) “zc:k:mage_LAYOUT_12B8E4E9B9664A88F620395C2B0E265C3″
3) “zc:ti:mage_PRODUCT_31489″
4) “zc:k:mage_LAYOUT_102DAFD20DE438A6CCEAB14C14CBD43E6″
5) “zc:k:mage_LAYOUT_12C9CC1468A49CEAAD89B704922CFA00D”
6) “zc:ti:mage_PRODUCT_32386″
7) “zc:k:mage_LAYOUT_145900AB7F6D4CEB9F4C7CDA3C3FDB3E0″
8) “zc:k:mage_Zend_LocaleL_en_GB_day_”
9) “zc:k:mage_LAYOUT_1570BAB63946016D4308F3846E31F3298″
10) “zc:k:mage_LAYOUT_1A81FEA2A13A548546F8C44C45F291E58″
11) “zc:k:mage_LAYOUT_178D667D0447D0D68CE44FA446B549C57″
12) “zc:k:mage_LAYOUT_1D9AB3A02AE7912CCD665FA0A14082DFE”
13) “zc:k:mage_LAYOUT_1EC736E7B6D5E1342588C904A476EF7A4″
14) “zc:ti:mage_PRODUCT_528″
15) “zc:ti:mage_PRODUCT_5001″
16) “zc:k:mage_LAYOUT_180058FA3A3E7ADD27514DD63BF803443″
17) “zc:k:mage_LAYOUT_149B9701C3A642D6FADE5A8C5EFAB3A53″
18) “zc:ti:mage_PRODUCT_5004″
19) “zc:k:mage_LAYOUT_1747906323D5671235BF2A45136D30FE6″
20) “zc:k:mage_LAYOUT_1F48BF80A73C5CDACE114DBC9168A79F9″

This should be the output.
If you are getting above output then Redis-Server is configured correctly and running. And above count should increase continuously.

For more reference :
–> http://redis.io/topics/quickstart
–> https://help.sonassihosting.com/magestack/installing-the-redis-magento-extension/
—————————————————————————————————————

How To Purchase Amazon EC2 Reserved Instance

Quickly understand reserved instance before purchasing from here.

If you’ve purchased a on demand EC 2 instance and later realized that it would run for a course of time(for ex. 1 year,2 year), you can convert it into reserved instance to save few bucks. Remember reserved instance is just a pricing feature, and no actual conversion is done to your instance.

Here we go - 

  • The following details of the on-demand instance (which you are reserving) will be required – Platform,Instance Type,Availability Zone.
  • Click on the Purchase Reserved Instance Button in your AWS console.
    click_purchase_reserved_instance
  • Click on search after selecting the appropriate details.
    search_reserved_instance
  • Offering Type -
    Light Utilization RI’s – Lowest upfront price,ideal  for periodic workloads that only run for couple of hours a day.
    Medium Utilization RI’s – Higher upfront price than Light Utilization RIs, but a much lower hourly usage fee,best suited for workloads that run most of the time, but have some variability in usage.
    Heavy Utilization RI’s – Highest upfront price,lowest hourly rate,,suitable for instance that run 24 hours.

  • search_result
  • Here you go,you can see your purchased instance in the reserved instance tab on left side of the AWS console.

Congratulations ! You just saved some bucks.

Quickly Understand Amazon ElasticCompute 2 Instances On-Demand/Spot/Reserved

Amazon EC2 Instance Purchasing Options 

Amazon EC2 provides three different purchasing models that gives you the flexibility to optimize your costs.

  • Amazon EC2 Reserved Instances

Reserved Instance is just a pricing feature.You agree to purchase your instance for a particular term which may be 1,2 or 3 years.On purchasing you have to pay one time upfront price.

Continue reading

Connecting to your Amazon EC2 Linux Instance from Windows Environment

Things to keep in mind

  • Ubuntu version 11.04+ is considered in this tutorial
  • Make sure Port 22 is opened in your security group.
  • You are on Windows Platform.
  • Since it is a Ubuntu instance, no GUI interface is available. All the tasks are done using CLI (Command Line Interface)
  • Refer to this tutorial for EIP/DNS/FQDN and Security Groups before proceeding, only if you are not familiar – http://wp.me/p31qfW-h Continue reading