Enable memcache automatic compression, starting at 20k and only if compression gain is greater than 20%.

Allows storage of larger objects (over 1mb in size uncompressed), such as huge LDAP schemas.
Should also improve cache efficiency (allows more stuff to be stored in same memory) and reduce network latency (less data transfer)

(redo commit 1e9c03e199 which was apparently lost during pluginization)
This commit is contained in:
Craig Andrews 2010-01-04 12:49:25 -05:00
parent a0f7896f22
commit 7a2d72fe28
1 changed files with 5 additions and 0 deletions

View File

@ -156,6 +156,11 @@ class MemcachePlugin extends Plugin
}
$this->_conn->addServer($host, $port);
}
//Compress items stored in the cache if they're over 2k in size
//and the compression would save more than 20%.
//Allows the cache to store objects larger than 1MB (if they
//compress to less than 1MB), and improves cache memory efficiency.
$this->_conn->setCompressThreshold(20000, 0.2);
}
}
}