Re-sync every so often, in case caches appear

anoa/temp_working_cache_config
Amber H. Brown 2019-11-22 00:05:12 +11:00
parent a14831d209
commit 50fcb4a8c5
2 changed files with 4 additions and 8 deletions

View File

@ -242,6 +242,7 @@ class HomeServer(object):
self.datastores = DataStores(datastore, conn, self) self.datastores = DataStores(datastore, conn, self)
conn.commit() conn.commit()
self.start_time = int(self.get_clock().time()) self.start_time = int(self.get_clock().time())
self.get_clock().looping_call(self.config.caches.resize_caches, 10000)
logger.info("Finished setting up.") logger.info("Finished setting up.")
def setup_master(self): def setup_master(self):
@ -252,7 +253,6 @@ class HomeServer(object):
""" """
for i in self.REQUIRED_ON_MASTER_STARTUP: for i in self.REQUIRED_ON_MASTER_STARTUP:
getattr(self, "get_" + i)() getattr(self, "get_" + i)()
self.config.caches.resize_caches()
def get_reactor(self): def get_reactor(self):
""" """

View File

@ -246,14 +246,10 @@ class StateGroupWorkerStore(
# We size the non-members cache to be smaller than the members cache as the # We size the non-members cache to be smaller than the members cache as the
# vast majority of state in Matrix (today) is member events. # vast majority of state in Matrix (today) is member events.
self._state_group_cache = DictionaryCache( # TODO: this hasn't been tuned yet
"*stateGroupCache*", self._state_group_cache = DictionaryCache("*stateGroupCache*", 50000)
# TODO: this hasn't been tuned yet
50000 * hs.config.caches.get_factor_for("stateGroupCache"),
)
self._state_group_members_cache = DictionaryCache( self._state_group_members_cache = DictionaryCache(
"*stateGroupMembersCache*", "*stateGroupMembersCache*", 500000
500000 * hs.config.caches.get_factor_for("stateGroupMembersCache"),
) )
@defer.inlineCallbacks @defer.inlineCallbacks