Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions lib/private/Memcache/MemcachedFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ public function init(): void {
$this->instance = new \Memcached();

$defaultOptions = [
\Memcached::OPT_CONNECT_TIMEOUT => 50,
\Memcached::OPT_RETRY_TIMEOUT => 50,
\Memcached::OPT_SEND_TIMEOUT => 50,
\Memcached::OPT_RECV_TIMEOUT => 50,
\Memcached::OPT_POLL_TIMEOUT => 50,
// Set connect and polling timeouts to 500 milliseconds
\Memcached::OPT_CONNECT_TIMEOUT => 500,
\Memcached::OPT_POLL_TIMEOUT => 500,

// Set send and receive timeouts to 500000 microseconds
\Memcached::OPT_SEND_TIMEOUT => 500000,
\Memcached::OPT_RECV_TIMEOUT => 500000,

// Enable compression
\Memcached::OPT_COMPRESSION => true,
Expand All @@ -47,6 +49,9 @@ public function init(): void {

// Enable Binary Protocol
\Memcached::OPT_BINARY_PROTOCOL => true,

// Disable Nagle algorithm to speed up connection
\Memcached::OPT_TCP_NODELAY => true,
];
/**
* By default enable igbinary serializer if available
Expand Down
Loading