mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-02-08 13:45:06 -05:00
memcache: Make minimum size for compression configurable per chain.
This allows us to trade off CPU time for bandwidth / cache space in different amounts on different cache chains since they have distinct behaviours.
This commit is contained in:
@@ -96,6 +96,7 @@ class CMemcache(CacheUtils):
|
||||
debug = False,
|
||||
noreply = False,
|
||||
no_block = False,
|
||||
min_compress_len=512 * 1024,
|
||||
num_clients = 10):
|
||||
self.servers = servers
|
||||
self.clients = pylibmc.ClientPool(n_slots = num_clients)
|
||||
@@ -111,7 +112,7 @@ class CMemcache(CacheUtils):
|
||||
client.behaviors.update(behaviors)
|
||||
self.clients.put(client)
|
||||
|
||||
self.min_compress_len = 512*1024
|
||||
self.min_compress_len = min_compress_len
|
||||
|
||||
def get(self, key, default = None):
|
||||
with self.clients.reserve() as mc:
|
||||
|
||||
Reference in New Issue
Block a user