From 8367895b130c9b52e18b04be65637e913cca4121 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Tue, 30 Apr 2013 17:31:39 -0700 Subject: [PATCH] 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. --- r2/r2/lib/cache.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/r2/r2/lib/cache.py b/r2/r2/lib/cache.py index 1dec79145..c9e7d8d82 100644 --- a/r2/r2/lib/cache.py +++ b/r2/r2/lib/cache.py @@ -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: