MemcacheStorageService

Overview

This StorageService, identified by type="MEMCACHE", stores data in one or a cluster of http://www.danga.com/memcached servers. The data persists across restarts of the SP itself, and supports shared access across nodes of a cluster. Locking is performed inside the plugin itself. Note that the memcache store itself is volatile so if the memcache servers restart, all the state is lost.

This plugin is included with only packaged versions of the software on which the OS provides a compatible memcache library. This does not include Windows and does not include all versions of Linux. If it's not found, this is the reason why.

Use of this plugin requires that its extension library memcache-store.so be loaded by the Service Provider via the <OutOfProcess> element's <Library> option.

Reference

Attributes

Settings specific to this type include:

Name

Type

Default

Description

Name

Type

Default

Description

prefix 

string



String prefix that gets appended to the keys so that there are no key name conflicts when different applications use the same memcache servers.

buildMap 

boolean

false

The memcache store is able to function in two modes: with or without a context map that allows the SP to store more complex data in the system. The SessionCache requires that we keep an additional data structure to deal with such contexts while the ReplayCache and ArtifactMap do not have that need.

sendTimeout 

microseconds

 999,999

Sets the timeout used for sending data on the socket.

recvTimeout 

microseconds

 999,999

Sets the timeout used for receiving data on the socket.

pollTimeout 

milliseconds

1000

Sets the timeout used for polling the socket.

failLimit 

integer

5

Sets the maximum number of errors that can happen when talking to a server before marking it as DEAD.

retryTimeout 

seconds

30

Sets the timeout used for trying to use a DEAD server.

nonBlocking 

0 or 1

1

Sets the behavior of the memcached lib. Non-blocking mode gives better performance and recovers better from errors.

All StorageService plugin types support the following attributes:

Child Elements

Name

Cardinality

Description

Name

Cardinality

Description

<Hosts>

1

A comma-delimited list of memache hosts.

Example

<OutOfProcess> <Extensions> <Library path="memcache-store.so" fatal="true"/> </Extensions> </OutOfProcess> <StorageService type="MEMCACHE" id="mc" prefix="SERVICE_PREFIX:"> <Hosts> 10.135.64.71:11211, 10.135.64.72:11211 </Hosts> </StorageService> <StorageService type="MEMCACHE" id="mc-ctx" prefix="SERVICE_PREFIX:" buildMap="1"> <Hosts> 10.135.64.71:11211, 10.135.64.72:11211 </Hosts> </StorageService>