Tuesday, November 10, 2015

Some fun with Memcached

0 lượt xem comment 0 comments

Memcahed is a K/V store. Its fast pretty much all operations are O(1). Memcached use Threads(Async and non-blocking IO) different from Redis with is single-thread. Memcached does not have a cluster, its a farm, some concerns like Replication need be handled by the clients or 3rd party application, nodes on the farm don't talk o each other so there is no GOSSIP. Memcached has few key/set operations in comparison with Redis. Redis have several. Some clients have the concept of the master-key / sub-key based on this it can locate what server has that specific key. Often keys are smaller than 250 chars and objects smaller than 1MB. Memcached if used for a lot lot of scenarios like: Profile Caching(Social Networking), Page Caching(HTML), Ad Targeting with cookie / profile tracking, Session caching for games and entertainment its pretty much for caching.

Installing, Configuring and Running

How to Install Memcache on Amazon Linux OS | CentOS

sudo yum install -y libevent libevent-devel
sudo yum install -y gcc make
sudo wget http://www.memcached.org/files/memcached-1.4.24.tar.gz
sudo tar xvzf memcached-1.4.24.tar.gz
cd memcached-1.4.24
sudo ./configure --enable-64bit
sudo make && sudo make install
memcached -d -u nobody -m 512 -p 11211 127.0.0.1

Test Memcache Installation with Telnet

sudo yum install -y telnet
telnet 127.0.0.1 11211
set key 0 900 4
data
get key 0 4
quit
view raw memcache.md hosted with ❤ by GitHub
cheers,
Diego Pacheco
Tags: no keyword

comment 0 comments

Chuyên mục văn hoá giải trí của VnExpress

.

© 2017 www.blogthuthuatwin10.com

Tầng 5, Tòa nhà FPT Cầu Giấy, phố Duy Tân, Phường Dịch Vọng Hậu, Quận Cầu Giấy, Hà Nội
Email: nguyenanhtuan2401@gmail.com
Điện thoại: 0908 562 750 ext 4548; Liên hệ quảng cáo: 4567.