Memcached: High-performance distributed memory cache server

Source: Internet
Author: User
Tags memcached

Memcached: high-performance distributed memory cache server

features :

The U protocol is simple :

n text-line-based protocols

U - libevent -based event handling :

N Library , can realize the increase of the number of connections , O (1) performance

U Internal Memory storage mode

n data stored in memory , restart data disappears , when data reaches a certain value , based on LRU (last recently used) algorithm to delete unused caches

U Memcached distributed non-communication

n the server side does not have distributed functionality , and the implementation is distributed depending on client

N

use of Memcached :

U Save the method :

N Add: save only if the storage space does not exist the same data

N Replace: save only if the storage space has the same data

N Set: save whenever

method of getting the u

N Get: take a data

N get_multi: fetching multiple data

U Delete Data

n Delete

U increment one and minus one operation

N incr

N ADD

Slab Allocation mechanism : allocating , managing memory Mechanisms

divide the memory into blocks of a certain length , block the same size , and Select the appropriate blocks based on the size of the data.

resolves a memory fragmentation problem , but creates a waste of memory ( such as 100bytes of data to be stored in a block of )

tuning : adjusting the block size of a group based on data size

data deletion aspects of Memcached

U Memcached does not really delete data , does not monitor expired data , but checks for expiration at get , This technique is called lazy ( lazy )

U LRU overwrites the least recently used data

Memcached 's Distributed

You are fully implemented by the client : based on the key , the client's algorithm to obtain which memcached server is stored , Fetch according to the same algorithm .

The function Library of the U-client cache::memcached realizes the distributed function

N dispersion based on the remainder : that is, according to the remainder of the number of servers scattered , to obtain the hash value of the key to take the remainder

N Cons : Add or remove Servers , the cost of cache reassembly is large

U consistent Hashing dispersion algorithm

N Find the hash value of each server and configure it to

Memcached: High-performance distributed memory cache server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.