Skip to content

Commit

Permalink
Improve syncing of big accounts: add caching, increase timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
MayeulC committed Aug 10, 2022
1 parent deea59a commit 3e450f9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
27 changes: 27 additions & 0 deletions conf/homeserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,33 @@ database:
#
#event_cache_size: 10K

caches:
# Controls the global cache factor, which is the default cache factor
# for all caches if a specific factor for that cache is not otherwise
# set.
#
# This can also be set by the "SYNAPSE_CACHE_FACTOR" environment
# variable. Setting by environment variable takes priority over
# setting through the config file.
#
# Defaults to 0.5, which will half the size of all caches.
#
# global_factor: 2.0

# Controls how long an entry can be in a cache without having been
# accessed before being evicted. Defaults to None, which means
# entries are never evicted based on time.
#
# expiry_time: 120m

# Controls how long the results of a /sync request are cached for after
# a successful response is returned. A higher duration can help clients with
# intermittent connections, at the cost of higher memory usage.
#
# By default, this is zero, which means that sync responses are not cached
# at all.
#
sync_response_cache_duration: 15m

## Logging ##

Expand Down
5 changes: 5 additions & 0 deletions conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ location __PATH__ {

client_max_body_size 100M;

# Use longer timeouts for the sync API
location __PATH__/client/r0/sync {
proxy_read_timeout 7m;
}

# Use the specific path for the php file. It's more secure than global php path
location __PATH__/cas_server.php {
alias /var/www/__APP__/;
Expand Down

0 comments on commit 3e450f9

Please sign in to comment.