cache_helpers: Disable filling message cache.

The message cache filling script actually used both database and
memcached queries as part of filling the cache (all used to compute
the needed display_recipient values).  We would ideally fix this by
using bulk operations to fill the display_recipient cache, but until
we do so, this cache filler is counterproductive.

I believe this disabling fixes an issue where memcached would get
overloaded and stop handling requests during a server restart on busy
servers.
This commit is contained in:
Tim Abbott 2016-08-12 21:42:55 -07:00
parent befd665b91
commit 924d0475c1
1 changed files with 4 additions and 1 deletions

View File

@ -71,7 +71,10 @@ cache_fillers = {
'client': (lambda: Client.objects.select_related().all(), client_cache_items, 3600*24*7, 10000),
'recipient': (lambda: Recipient.objects.select_related().all(), recipient_cache_items, 3600*24*7, 10000),
'stream': (lambda: Stream.objects.select_related().all(), stream_cache_items, 3600*24*7, 10000),
'message': (message_fetch_objects, message_cache_items, 3600 * 24, 1000),
### Message cache fetching disabled until we can fix the fact that it
### does a bunch of inefficient memcached queries as part of filling
### the display_recipient cache
# 'message': (message_fetch_objects, message_cache_items, 3600 * 24, 1000),
'huddle': (lambda: Huddle.objects.select_related().all(), huddle_cache_items, 3600*24*7, 10000),
'session': (lambda: Session.objects.all(), session_cache_items, 3600*24*7, 10000),
} # type: Dict[str, Tuple[Callable[[], List[Any]], Callable[[Dict[text_type, Any], Any], None], int, int]]