89388

89388



memcached Hashing/Distribution Types

The memcached Client interface supports a number of different distribution algorithms that are used in

multi-server configurations to determine which host should be used when setting or getting data from

a given memcached instance. When you get or set a value, a hash is constructed from the supplied

key and then used to select a host from the list of configured servers. Because the hashing mechanism

uses the supplied key as the basis for the hash, the same server is selected during

both set and get

operations.

You can think of this process as follows. Given an array of servers (a, b, and c), the Client uses a

hashing algorithm that returns an integer based on the key being stored or retrieved. The resulting

value is then used to select a server from the list of servers configured in the Client. Most standard

Client hashing within memcache clients uses a simple modulus calculation on the value against the

number of configured memcached servers. You can summarize the process in pseudocode as:

@memc3ervers = ['a.memc','b.raemc','c.memc'];

$value = hash($key);

$chosen = $value % length(0memcservers);

Replacing the above with values:

0memc3ervers - [ 'a. memc', 'b.memc', 'c. memc' ];

$value - hash('myid');

$chosen ■ 7009 % 3;

In the above example, the Client hashing algorithm chooses the server at index 1

(7009 % 3 = 1),

and storę or retrieve the key and value with that server.



Wyszukiwarka

Podobne podstrony:
memcached Deployment When using memcached you can use a number of different potential deployment str
Using MySQL and memcached with Ruby There are a number of different modules for interfacing to memca
Using MySQL Proxy There are a number of different ways to use MySQL Proxy. At the most basie level,
nism in which the individual decays.25 A diminished opportunity of differentiation or, to be morę Pr
PG038 76 FoodJapanese Food There are a great number of different kinds of eating places in Japan. Am
Quantiles 11 Ouantiles and the ąuartite dewation r- Expenditure (£) Number of companies Less than
Throughout the passage, Sulekha identifies the hijras’ linguistic behavior with a variety of differe
Developing a memcached Application A number of language interfaces let applications storę and retrie
Using the InnoDB memcached Plugin with Replication Because the InnoDB memcached daemon plugin suppor
Slajd16 (113) Hun]RAM types The traditional RAM type is DRAM (dynamie RAM). The other type is SRAM (
2. Fili in the blanks. a.    An atom is built of three types
Haddaway All The?st Greatest Hits(back) (LC) 07472)    ©1999 BMG Ariola Munchen GmbH.
Open interfaces of GSMMobile Station (MS) The MS (Mobile Station) is a combination of terminal equip
New Ul Design.Making Frequently Used Apps Easy to Open The redesigned Ul interface matches the eye-c
Obtain and Unpackthe Distribution Pick the directory under which you want to unpack the distribution
Obtain and Unpack the Distribution Pick the directory under which you want to unpack the distributio
About Table Types The most common typc of table in an Oracle databasc is a relational table. which i

więcej podobnych podstron