Runtime Configuration

The behaviour of these functions is affected by settings in php.ini.

Memcached Configure Options
Name Default Changeable Changelog
memcached.sess_locking 1 PHP_INI_ALL
memcached.sess_consistent_hash 0 PHP_INI_ALL
memcached.sess_binary 0 PHP_INI_ALL
memcached.sess_lock_wait 150000 PHP_INI_ALL
memcached.sess_prefix memc.sess.key. PHP_INI_ALL
memcached.sess_number_of_replicas 0 PHP_INI_ALL
memcached.sess_randomize_replica_read 0 PHP_INI_ALL
memcached.sess_remove_failed 0 PHP_INI_ALL
memcached.compression_type fastlz PHP_INI_ALL
memcached.compression_factor 1.3 PHP_INI_ALL
memcached.compression_threshold 2000 PHP_INI_ALL
memcached.serializer php PHP_INI_ALL
memcached.use_sasl 0 PHP_INI_SYSTEM

Here's a short explanation of the configuration directives.

memcached.sess_locking integer

Use session locking. Valid values: On, Off, the default is On.

memcached.sess_consistent_hash integer

Memcached session consistent hash mode. If set to On, consistent hashing is used for session handling. When consistent hashing is used, one can add or remove cache node(s) without messing up too much with existing keys. The default is Off.

memcached.sess_binary integer

Use memcached session binary mode. Libmemcached replicas only work if binary mode is enabled. The default is Off.

memcached.sess_lock_wait integer

Session spin lock retry wait time in microseconds. Be carefull when setting this value. Valid values are integers, where 0 is interpreted as the default value. Negative values result in a reduces locking to a try lock. The default is 150000.

memcached.sess_prefix string

Memcached session key prefix. Valid values are strings less than 219 bytes long. The default value is "memc.sess.key."

memcached.sess_number_of_replicas integer

The memcached session number of replicas.

memcached.sess_randomize_replica_read integer

Memcached session replica read randomize.

memcached.sess_remove_failed integer

Allow failed memcached server to automatically be removed.

memcached.compression_type string

Set the compression type, valid values are: fastlz, zlib. The default is fastlz.

memcached.compression_factor float

Compression factor. Store compressed value only if the compression factor (saving) exceeds the set limit. Store compressed if: plain_len > comp_len * factor. The default value is 1.3 (23% space saving).

memcached.compression_threshold integer

The compression threshold. Do not compress serialized values below this threshold. The default is 2000 bytes.

memcached.serializer string

Set the default serializer for new memcached objects. Valid values are: php, igbinary, json, json_array.

json

Standard php JSON encoding. This serializer is fast and compact but only works on UTF-8 encoded data and does not fully implement serializing. See the JSON extension.

json_array

As json, but decodes into arrays.

php

The standard PHP serializer.

igbinary

A binary serializer

The default is igbinary if available and php otherwise.

memcached.use_sasl integer

Use SASL authentication for connections. Valid values: On, Off. The default is Off.