[Cache] enable Memcached::OPT_TCP_NODELAY to fix perf of misses
This commit is contained in:
parent
817e7cdfaa
commit
8b59d177db
@ -89,6 +89,7 @@ class MemcachedAdapterTest extends AdapterTestCase
|
||||
|
||||
$this->assertTrue($client->getOption(\Memcached::OPT_COMPRESSION));
|
||||
$this->assertSame(1, $client->getOption(\Memcached::OPT_BINARY_PROTOCOL));
|
||||
$this->assertSame(1, $client->getOption(\Memcached::OPT_TCP_NODELAY));
|
||||
$this->assertSame(1, $client->getOption(\Memcached::OPT_LIBKETAMA_COMPATIBLE));
|
||||
}
|
||||
|
||||
|
@ -134,6 +134,7 @@ trait MemcachedTrait
|
||||
$options = array_change_key_case($options, CASE_UPPER);
|
||||
$client->setOption(\Memcached::OPT_BINARY_PROTOCOL, true);
|
||||
$client->setOption(\Memcached::OPT_NO_BLOCK, true);
|
||||
$client->setOption(\Memcached::OPT_TCP_NODELAY, true);
|
||||
if (!array_key_exists('LIBKETAMA_COMPATIBLE', $options) && !array_key_exists(\Memcached::OPT_LIBKETAMA_COMPATIBLE, $options)) {
|
||||
$client->setOption(\Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user