downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

リソース型> <インストール手順
[edit] Last updated: Fri, 10 Feb 2012

view this page in

実行時設定

php.ini の設定により動作が変化します。

Memcache 設定オプション
名前 デフォルト 変更可能 変更履歴
memcache.allow_failover "1" PHP_INI_ALL memcache 2.0.2 以降で使用可能です
memcache.max_failover_attempts "20" PHP_INI_ALL memcache 2.1.0 以降で使用可能です
memcache.chunk_size "8192" PHP_INI_ALL memcache 2.0.2 以降で使用可能です
memcache.default_port "11211" PHP_INI_ALL memcache 2.0.2 以降で使用可能です
memcache.hash_strategy "standard" PHP_INI_ALL memcache 2.2.0 以降で使用可能です
memcache.hash_function "crc32" PHP_INI_ALL memcache 2.2.0 以降で使用可能です
session.save_handler "files" PHP_INI_ALL memcache 2.1.2 以降で使用可能です
session.save_path "" PHP_INI_ALL memcache 2.1.2 以降で使用可能です
memcache.protocol ascii >PHP_INI_ALL memcache 3.0.0 以降で使用可能です
memcache.redundancy 1 >PHP_INI_ALL memcache 3.0.0 以降で使用可能です
memcache.session_redundancy 2 >PHP_INI_ALL memcache 3.0.0 以降で使用可能です
memcache.compress_threshold 20000 >PHP_INI_ALL memcache 3.0.3 以降で使用可能です
memcache.lock_timeout 15 >PHP_INI_ALL memcache 3.0.4 以降で使用可能です
PHP_INI_* モードの詳細および定義については どこで設定を行うのか を参照してください。

以下に設定ディレクティブに関する 簡単な説明を示します。

memcache.allow_failover boolean

エラー時に、透過的なフェイルオーバーを行うかどうかを指定します。

memcache.max_failover_attempts integer

データの設定や取得を試みるサーバの数を指定します。 memcache.allow_failover を指定した場合にのみ使用します。

memcache.chunk_size integer

データは、ここで指定した大きさに分割されます。 この値を小さくすると、ネットワークに対する書き込みが多くなります。 不可解な速度低下が発生する場合は、この値を 32768 まで大きくしてください。

memcache.default_port string

memcached サーバに接続する際に、 デフォルトで使用される TCP ポート番号。

memcache.hash_strategy string

キーをサーバと関連づけるために使用する方式を制御します。この値を consistent にすると、一貫したハッシュを使用します。 これにより、サーバを追加したり削除したりした際にキーの再マッピングの必要がなくなります。 この値を standard にすると、以前の方法を使用します。

memcache.hash_function string

キーをサーバに関連づける際に使用するハッシュ関数を制御します。 crc32 は標準の CRC32 ハッシュを、そして fnv は FNV-1a を使用します。

session.save_handler string

memcache をセッションハンドラとして使用するには、この値を memcache と設定します。

session.save_path string

セッションを格納するためのサーバの URL を、カンマ区切りで指定します。たとえば "tcp://host1:11211, tcp://host2:11211" のようになります。

個々の URL には、そのサーバ用のパラメータを含めることができます。これは Memcache::addServer() メソッドと同じ形式です。たとえば "tcp://host1:11211?persistent=1&weight=1&timeout=1&retry_interval=15" のようになります。

memcache.protocol string

memcache.redundancy integer

memcache.session_redundancy integer

memcache.compress_threshold integer

memcache.lock_timeout integer



リソース型> <インストール手順
[edit] Last updated: Fri, 10 Feb 2012
 
add a note add a note User Contributed Notes 実行時設定
info at phpgangsta dot de 14-Jan-2011 05:34
Since 3.0.0 there are new defaults:

memcache.hash_strategy = consistent
memcache.chunk_size = 32768
kross at escapistmag dot com 22-Mar-2010 06:06
There's a currently undocumented variable that is now available (you can see it in php_info()) for session handling:

memcache.session_redundancy

The default seems to be "2", and it is supposed to influence how many copies of a particular session object that Memcache will store for failover purposes (so with a redundancy of 2, it will store a session on 2 different shards).

This will add slight overhead with extra writes, but overall seems worth it for purposes of failover.
ruben [AT] ruben dot cn 23-Oct-2008 03:05
Please note that when you specify more than one memcached server, you don't get the session data copied to every memcached server. Info is only copied to the first one. If the 1st server is down, it goes for the second (but the second will lack the info stored into the 1st one)

 
show source | credits | stats | sitemap | contact | advertising | mirror sites