summary refs log tree commit diff
path: root/synapse/storage/_base.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2017-11-13 11:56:22 +0000
committerRichard van der Hoff <richard@matrix.org>2017-11-13 11:56:22 +0000
commit8b33ac8f6c39b9debf89f1e96c72549cae29ae5f (patch)
tree7b48d39b17a82fa3751f5429b77bd5f7803aa40f /synapse/storage/_base.py
parentFix 500 on invalid utf-8 in request (diff)
parentRevert "move _state_group_cache to statestore" (diff)
downloadsynapse-8b33ac8f6c39b9debf89f1e96c72549cae29ae5f.tar.xz
Merge branch 'develop' into rav/invalid_request_utf8
Diffstat (limited to 'synapse/storage/_base.py')
-rw-r--r--synapse/storage/_base.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py
index a37d1934ec..6caf7b3356 100644
--- a/synapse/storage/_base.py
+++ b/synapse/storage/_base.py
@@ -16,6 +16,8 @@ import logging
 
 from synapse.api.errors import StoreError
 from synapse.util.logcontext import LoggingContext, PreserveLoggingContext
+from synapse.util.caches import CACHE_SIZE_FACTOR
+from synapse.util.caches.dictionary_cache import DictionaryCache
 from synapse.util.caches.descriptors import Cache
 from synapse.storage.engines import PostgresEngine
 import synapse.metrics
@@ -178,6 +180,10 @@ class SQLBaseStore(object):
         self._get_event_cache = Cache("*getEvent*", keylen=3,
                                       max_entries=hs.config.event_cache_size)
 
+        self._state_group_cache = DictionaryCache(
+            "*stateGroupCache*", 100000 * CACHE_SIZE_FACTOR
+        )
+
         self._event_fetch_lock = threading.Condition()
         self._event_fetch_list = []
         self._event_fetch_ongoing = 0