RSS구독하기:SUBSCRIBE TO RSS FEED
즐겨찾기추가:ADD FAVORITE
글쓰기:POST
관리자:ADMINISTRATOR

What is Memcached?

Memcached is an open source distributed memory object caching program that allows us to improve and speeding up performance of dynamic web applications by caching data and objects in Memory. Memcached is also used to cache entire database tables and queries to improve performance of database. It is the only one caching system available freely and used by many big sites like YouTube, Facebook, Twitter, Reddit, Drupal, Zynga etc.

Enable EPEL repository under RHEL/CentOS 6.3/5.8

The fastest and easiest way to install and enable EPEL repository using YUM. First, select the RPM that matches your Linux OS architecture from the provided links and install it using method shown in below. The EPEL repo will install all the required dependency packages for memcached. (Note : Fedora doesn’t required EPEL repo, because it is part of fedora project).

For RHEL/CentOS 6 ( 32-Bit )

# wget http://mirrors.kernel.org/fedora-epel/6/i386/epel-release-6-7.noarch.rpm
# rpm -Uvh epel-release-6-7.noarch.rpm

For RHEL/CentOS 6 ( 64-Bit )

# wget http://mirrors.kernel.org/fedora-epel/6/x86_64/epel-release-6-7.noarch.rpm
# rpm -Uvh epel-release-6-7.noarch.rpm

For RHEL/CentOS 5 ( 32-Bit )

# wget http://mirrors.kernel.org/fedora-epel/5/i386/epel-release-5-4.noarch.rpm
# rpm -Uvh epel-release-5-4.noarch.rpm

For RHEL/CentOS 5 ( 64-Bit )

# wget http://mirrors.kernel.org/fedora-epel/5/x86_64/epel-release-5-4.noarch.rpm
# rpm -Uvh epel-release-5-4.noarch.rpm

Install Memcached

Install Memcached program by using following command with YUM tool.

# yum install memcached
Sample Output
Loaded plugins: fastestmirror
Determining fastest mirrors
epel: kartolo.sby.datautama.net.id
Dependencies Resolved

=====================================================================================================
 Package			Arch				Version					Repository					Size
=====================================================================================================
Installing:			
memcached			i386				1.4.5-1.el5				epel						71 k

Transaction Summary
=====================================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 71 k
Is this ok [y/N]: y
Downloading Packages:
memcached-1.4.5-1.el5.i386.rpm													|  71 kB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : memcached														          1/1

Installed:
  memcached.i386 0:1.4.5-1.el5

Complete!

Configure Memcached

Open the file called /etc/sysconfig/memcached with VI editor.

# vi /etc/sysconfig/memcached

Set or update parameters as follows, save the file and exit.

# Running on Port 11211
PORT="11211"

# Start as memcached daemon
USER="memcached"

# Set max simultaneous connections to 1024
MAXCONN="1024"

# Set Memory size to 2048 - 4GB(4096)
CACHESIZE="2048"

#Set server IP address
OPTIONS="-l 127.0.0.1"

Let’s discuss each of the above parameters in details.

  1. PORT : The port used by memcached to run.
  2. USER : The start-up daemon for memcached service.
  3. MAXCONN : The value used to set max simultaneous connections to 1024. For busy web servers you can increase to any number based on your requirements.
  4. CACHESIZE : Set cache size memory to 2048. For busy servers you can increase upto 4GB.
  5. OPTIONS : Set IP address of server, so that Apache or Nginx web servers can connect to it.

Start Memcached

Type the following commands to start and restart the Memcached daemon.

# chkconfig --levels 235 memcached on
# /etc/init.d/memcached start
# /etc/init.d/memcached restart

To stop and check status, use the following commands.

# /etc/init.d/memcached stop
# /etc/init.d/memcached status

Verify Memcached

Use netstat command to verify Memcached is running.

# netstat -tulpn | grep :11211

tcp        0      0 127.0.0.1:11211             0.0.0.0:*                   LISTEN      20775/memcached
udp        0      0 127.0.0.1:11211             0.0.0.0:*                               20775/memcached

Check the stats of the server using memcached-tool.

# memcached-tool 127.0.0.1 stats

Install Memcached PHP extension

Now, install PHP extension to work with Memcached daemon.

# yum install php-pecl-memcache

Install Memcached Perl Library

Install perl library for Memcached.

# yum install perl-Cache-Memcached

Install Memcached Python Library

Install python library for Memcached.

# yum install python-memcached

Restart Apache

Restart the Apache service to reflect changes.

# /etc/init.d/httpd restart
OR
# service httpd restart

Configure Firewall to Secure Memcached Server

Make sure you only have access to memcached server, to enable access to your own servers open file called /etc/sysconfig/iptables.

# vi /etc/sysconfig/iptables

Append the following iptables rules to allow access to your own servers.

## Enable access on IP ranges from 172.16.1.1 to 172.16.1.10 for Port 11211 ##
# iptables -A INPUT -p tcp --destination-port 11211 -m state --state NEW  -m iprange --src-range 172.16.1.1-172.16.1.10 -j ACCEPT
# iptables -A INPUT -p udp --destination-port 11211 -m state --state NEW  -m iprange --src-range 172.16.1.1-172.16.1.10 -j ACCEPT

Restart the iptables service to reflect changes.

# service iptables restart
OR
# /etc/init.d/iptables restart

Cache MySQL Queries with Memcached

It isn’t an easy task for all, you need to use API’s to modify your PHP codes to enable MySQL caching. You can find the examples codes at Memcache with MySQL and PHP.

Enable Memcached on WordPress Sites

For WordPress based sites, there is a plugin called Memcached Object Cache that you need to install it on your WordPress CMS.

2013/11/08 15:01 2013/11/08 15:01
http://zosel.net/trackback/85
from.jordan scarpe online  2015/06/01 10:29
<a href="http://altaviadeimontiliguri.it">jordan scarpe</a>
from.2015 nba champion jerseys  2015/06/26 13:34
<a href="http://championsbrandnbajerseys.wordpress.com">champion brand nba jerseys</a>
from.cheapest birkenstock sandals  2015/11/10 18:27
birkenstock on sale
from.Spaccio Ugg  2015/11/10 20:29
nike free run tiffany blue
from.Australia Ugg  2015/11/10 20:29
free run nike
from.Ugg Stivali Offerte  2015/11/11 11:18
nike shoes athletic
from.Ugg Style  2015/11/12 20:11
buy online nike air max
from.Stivali Ugg Bambina  2015/11/13 04:01
low priced nike shoes
from.Ugg Catania  2015/11/13 08:45
nike free 4.0 v3 womens
from.Saldi Ugg Australia  2015/11/13 22:47
mcm london 2014 dates
from.Negozi Ugg A Roma  2015/11/15 15:25
free run 3 nike women
from.Stivali Simil Ugg  2015/11/15 22:34
nike air max run lite ladies running shoes
from.Stivali Ugg 2013  2015/11/15 23:18
nike outlet new orleans
from.Costo Ugg  2015/11/16 10:25
nike oulet
from.Ugg Italia Sito Ufficiale  2015/11/16 10:49
nike air max 95 trainers
from.Pulizia Ugg  2015/11/18 11:02
nike outlet woodburn oregon
from.Ugg Short Classic  2015/11/18 18:00
white nike shoes
from.Ugg Sito Ufficiale Italiano  2015/11/18 22:21
nike air max air
from.Boots Ugg Online  2015/11/19 00:04
nike shoes to customize
from.Zoccoli Ugg  2015/11/21 05:02
nike wholesale
from.Stivali Ugg Outlet Italia  2015/11/21 08:46
nike air max 2013 sale
from.Pulizia Ugg  2015/11/23 18:26
nike free run 3.0 womens cheap
from.Ugg Australian  2015/11/26 15:11
nike free run size 14
from.Mcm Backpack Medium  2016/02/04 18:41
are nike air max for running
from.Vintage Mcm Bags  2016/02/05 01:06
cheap nike 90 air max
from.Mcm Purses For Cheap  2016/02/05 10:21
nike free run online outlet
from.Small Mcm Backpack  2016/02/05 12:47
nike free design your own
from.Mcm Handbags Official Site  2016/02/06 07:15
free run by nike
from.Mcm Leather  2016/02/06 19:57
nike musique
from.Mcm Wallet For Sale  2016/02/07 14:42
nike id australia
from.Come Pulire Gli Ugg  2016/02/08 03:27
cheap nike free run black
from.Mcm London Comic Con 2014 Guests  2016/02/08 08:24
mcm shopping
from.Mcm White Bag  2016/02/08 17:52
nike outlet shoe store
from.Mcm Mens  2016/02/09 02:00
mens 2014 nike air max
from.Mcm White Bag  2016/02/09 23:36
nike air max 2014 buy online
from.Ugg Recensioni  2016/02/10 07:21
nike free 7
from.Mcm Purses On Sale  2016/02/10 13:35
black nike shoes for men
from.Mcm Bags White  2016/02/11 01:54
nike free run 3 4.0
from.Scarpe Ugg Milano  2016/02/11 04:42
nike free free 5.0
from.Mcm Electonics  2016/02/11 05:00
design nike free run
from.Mcm London Map  2016/02/12 00:50
first ever nike air max
from.Mcm Belts  2016/02/12 02:03
nike air max 90 custom
from.New Mcm Bags  2016/02/12 20:34
nike runners women
from.Mcm Electronics Uk  2016/02/13 13:41
nike air max fly
from.Cheap Mcm Bags  2016/02/13 16:16
nike air max flight
from.Mcm Duffle Bag  2016/02/13 20:23
nike outlet st augustine
from.Mcm Bags Vintage  2016/02/14 02:10
where is the nearest nike outlet store
from.Mcm Wallet Online Store  2016/02/14 08:22
nike air max buy online
from.Ugg Shop Online  2016/02/14 14:00
cheap nike air force shoes
from.Mcm M眉nchen  2016/02/14 14:20
discount mcm bags
from.Ugg Colori 2013  2016/02/14 16:58
mcm coupon
from.Mcm Leather  2016/02/14 20:28
discount nike shoes
from.Mcm Store Korea  2016/02/14 22:02
nike free run 3 cheap
from.Mcm Electronics Coupon Code  2016/02/15 02:40
nike shox turbo 11
from.Mcm Handbags Cheap  2016/02/15 07:47
nike shoes sport
from.Birmingham Mcm 2014  2016/02/16 00:21
nike air max courtballistec 3.3
from.Pantofole Ugg  2016/02/16 01:49
mcm korea online shop
from.Ugg Italia Negozi  2016/02/18 13:05
nike free run gold
from.非洲艾可力  2016/02/18 17:00
艾可力清洁膏
from.Stivali Ugg Outlet  2016/02/19 00:53
mcm official store
from.Ugg Taglie  2016/02/19 04:30
nike outlet shopping online
from.Mcm Jacket  2016/02/21 06:44
nike air max light black
from.Ugg Modelli 2013  2016/02/21 06:48
nike factory store coupon
from.Ugg Boots Italia Online  2016/02/23 11:49
cheap nike shoe outlet
from.Mcm Bag For Cheap  2016/02/23 12:37
tanger nike outlet
from.Mcm Bag London  2016/02/23 14:29
nike cheap free runs
from.Mcm Bag Cheap  2016/02/24 14:03
2014 womens nike air max
from.Ugg Inverno 2013  2016/02/25 18:19
nike id sign in
from.Ugg Colori  2016/02/27 21:44
nike max air sneakers
from.Oakley Sunglasses Wholesale  2016/02/28 00:34
nike air max blue women
from.Wholesale Discount Oakley Sunglasses  2016/03/01 02:39
nike store factory
from.Ray Ban Customer Service  2016/03/01 08:49
buy nike shoes online cheap
from.Sunshine Oakley  2016/03/05 03:17
how much are nike free runs 5.0
from.Oakley Vault Youth  2016/03/05 09:41
http://znienacka.firehost.pl/wp-admin/includes/cheap-oakley-sungasses/Cheap-Oakley-Batwolf-Sunglasses-0q8nqr.htmlCheap Oakley Batwolf Sunglasses
from.2011 Oakley Sunglasses  2016/03/05 09:46
nike air max gym shoes
from.Discount Oakley Bottle Rocket  2016/03/07 07:00
nike outlet shoes online
from.Buy Cheap Oakley  2016/03/07 07:01
nike free run 5.0 v4
from.Sunglasses Oakley Sale  2016/03/07 20:35
sneakers nike
from.Polarized Oakley Sunglasses  2016/03/09 11:06
red mcm backpack
from.Cheap Oakley Sunglasses For Sale  2016/03/11 15:33
mcm london october 2014
from.Oakley Sunglasses On Sale  2016/03/13 02:25
coupons for nike outlet
from.Oakley Outlet Deer Park  2016/03/13 22:57
cheap nike clothing
from.nike air max  2016/03/16 00:54
::: ZOSEL ::: :: Memcached for CentOS,nike air max
from.Oakley Sunglass Clearance  2016/03/16 15:27
latest nike shoes
ZOSEL:Too much is as bad as too little...!! 자공(子貢)이 공자에게 "사(師:子張의 이름)와 상(商:子夏의 이름)은 어느 쪽이 어집니까?" 하고 묻자, 공자는 "사는 지나치고 상은 미치지 못한다"고 대답하였다. "그럼 사가 낫단 말씀입니까?" 하고 반문하자, 공자는 "지나친 것은 미치지 못한 것과 같다(過猶不及)"고 말하였다.
Too much is as bad as too little...!! 자공(子貢)이 공자에게 "사(師:子張의 이름)와 상(商:子夏의 이름)은 어느 쪽이 어집니까?" 하고 묻자, 공자는 "사는 지나치고 상은 미치지 못한다"고 대답하였다. "그럼 사가 낫단 말씀입니까?" 하고 반문하자, 공자는 "지나친 것은 미치지 못한 것과 같다(過猶不及)"고 말하였다.
전체 (209)
리눅스시스템 (92)
윈도우시스템 (16)
프로그램 (7)
네트워크시스템 (7)
최근관심 (1)
«   2024/05   »
      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  
  1. yeezyboost-350.co.uk  2021
    yeezyboost-350.co.uk
  2. 강남역 풀싸롱  2021
    강남역 풀싸롱
  3.   2021
  1. 2018/02 (1)
  2. 2017/03 (2)
  3. 2016/12 (2)