From a8e6bdfa33f3232ebc8f241b9c90e4da9191a627 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Fri, 3 Mar 2023 23:02:23 +0000 Subject: [performance] cache media attachments (#1525) * replace concurrency worker pools with base models in State.Workers, update code and tests accordingly * add media attachment caching, slightly tweak default cache config * further tweak default cache config values * replace other media attachment db calls to go through cache * update envparsing test * fix delete media attachment sql * fix media sql query * invalidate cached media entries during status create / update * fix envparsing test * fix typo in panic log message... * add 'updated_at' column during UpdateAttachment * remove unused func --------- Signed-off-by: kim --- example/config.yaml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'example') diff --git a/example/config.yaml b/example/config.yaml index 2239e0ba6..74c47dd8b 100644 --- a/example/config.yaml +++ b/example/config.yaml @@ -239,13 +239,13 @@ cache: # ttl = cached object lifetime # sweep-freq = frequency to look for stale cache objects - account-max-size: 100 + account-max-size: 500 account-ttl: "5m" - account-sweep-freq: "10s" + account-sweep-freq: "30s" block-max-size: 100 block-ttl: "5m" - block-sweep-freq: "10s" + block-sweep-freq: "30s" domain-block-max-size: 1000 domain-block-ttl: "24h" @@ -253,35 +253,39 @@ cache: emoji-max-size: 500 emoji-ttl: "5m" - emoji-sweep-freq: "10s" + emoji-sweep-freq: "30s" emoji-category-max-size: 100 emoji-category-ttl: "5m" - emoji-category-sweep-freq: "10s" + emoji-category-sweep-freq: "30s" + + media-max-size: 500 + media-ttl: "5m" + media-sweep-freq: "30s" mention-max-size: 500 mention-ttl: "5m" - mention-sweep-freq: "10s" + mention-sweep-freq: "30s" notification-max-size: 500 notification-ttl: "5m" - notification-sweep-freq: "10s" + notification-sweep-freq: "30s" report-max-size: 100 report-ttl: "5m" - report-sweep-freq: "10s" + report-sweep-freq: "30s" status-max-size: 500 status-ttl: "5m" - status-sweep-freq: "10s" + status-sweep-freq: "30s" tombstone-max-size: 100 tombstone-ttl: "5m" - tombstone-sweep-freq: "10s" + tombstone-sweep-freq: "30s" user-max-size: 100 user-ttl: "5m" - user-sweep-freq: "10s" + user-sweep-freq: "30s" ###################### ##### WEB CONFIG ##### -- cgit v1.2.3