Configurația la rulare

Comportamentul acestor funcții este afectat de parametrii stabiliți în php.ini.

Memcached Opțiuni de configurare pentru
Denumire Valoare implicită Poate fi modificată Jurnal al modificărilor
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

Iată o explicație pe scurt a directivelor de configurare.

memcached.sess_locking int

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

memcached.sess_consistent_hash int

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 int

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

memcached.sess_lock_wait int

Session spin lock retry wait time in microseconds. Be careful 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 int

The memcached session number of replicas.

memcached.sess_randomize_replica_read int

Memcached session replica read randomize.

memcached.sess_remove_failed int

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 int

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 int

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

add a note add a note

User Contributed Notes 3 notes

up
3
senz
10 years ago
In case, you are wondering why your sessions are "killed" after 1440 seconds, take a look at session.gc_maxlifetime. It's value is used in memcached expiration field according to memcache protocol rules. Also, do not forget about cookie expiration time
up
0
Piotr Gabryjeluk
7 years ago
Apparently in version 3.0.3 the default for memcached.sess_binary_protocol in TRUE. Also note the key is memcached.sess_binary_protocol, not memcached.sess.

Setting memcached.sess_binary_protocol to FALSE is required if you want to save the session to memcached through twemproxy.
up
-1
adolfoabegg at gmail dot com
12 years ago
you can get the list of the possible options for the memcached.ini configuration file here:
https://github.com/php-memcached-dev/php-memcached/blob/master/memcached.ini
To Top