php memcached 中的 server_key 是什么?
what is the server_key in php memcached?
php 文档描述和示例:
public array Memcached::getServerByKey ( string $server_key )
<?php
$m = new Memcached();
$m->addServer('mem1.domain.com', 11211, 33);
$m->addServer('mem2.domain.com', 11211, 67);
?>
我找不到 server_key 参数。
server_key在哪里?
如何使用***按键功能?
Memcached::addByKey()
Memcached::deleteByKey()
Memcached::getServerByKey()
...
来自http://php.net/manual/en/memcached.getserverbykey.php:
server_key
The key identifying the server to store the value on or
retrieve it from. Instead of hashing on the actual key for the item,
we hash on the server key when deciding which memcached server to talk
to. This allows related items to be grouped together on a single
server for efficiency with multi operations.
通常,memcached 服务器是根据您存储的密钥选择的(例如 Memcached::add("key", "value")
根据 "key"
选择要使用的服务器)。通过指定服务器密钥,您可以更改选择的服务器。
因此,如果您想通过存储或查找的键以外的其他方式对值进行分组,那么您可以提供一些东西。
php 文档描述和示例:
public array Memcached::getServerByKey ( string $server_key )
<?php
$m = new Memcached();
$m->addServer('mem1.domain.com', 11211, 33);
$m->addServer('mem2.domain.com', 11211, 67);
?>
我找不到 server_key 参数。 server_key在哪里?
如何使用***按键功能?
Memcached::addByKey()
Memcached::deleteByKey()
Memcached::getServerByKey()
...
来自http://php.net/manual/en/memcached.getserverbykey.php:
server_key
The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
通常,memcached 服务器是根据您存储的密钥选择的(例如 Memcached::add("key", "value")
根据 "key"
选择要使用的服务器)。通过指定服务器密钥,您可以更改选择的服务器。
因此,如果您想通过存储或查找的键以外的其他方式对值进行分组,那么您可以提供一些东西。