Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve syncing of big accounts: add caching, increase timeout #321

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ After that you can install it without problem.
The package uses a prebuilt python virtual environnement. The binary are taken from this repository: https://github.com/Josue-T/synapse_python_build
The script to build the binary is also available.

### Performance Tuning

Depending on the amount of RAM on your système, you might want to tune the cache configuration in `/etc/matrix-synapse/homeserver.yaml`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be good to put this in a specific file like /etc/matrix-synapse/conf.d/cache.yaml to avoid that this settings is always override by the update.

And the best solution is to give the possibility to edit this from the config pannel.


### Web client

If you want a web client you can also install Element with this package: https://github.com/YunoHost-Apps/element_ynh .
Expand Down
4 changes: 4 additions & 0 deletions README_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ After that you can install it without problem.
The package uses a prebuilt python virtual environnement. The binary are taken from this repository: https://github.com/Josue-T/synapse_python_build
The script to build the binary is also available.

### Amélioration de la performance

En fonction de la quantité de RAM de votre système, vous voudrez peut-être augmenter ou diminuer la taille des caches dans `/etc/matrix-synapse/homeserver.yaml`

### Web client

If you want a web client you can also install Element with this package: https://github.com/YunoHost-Apps/element_ynh .
Expand Down
27 changes: 27 additions & 0 deletions conf/homeserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,33 @@ database:
#args:
#database: /root/homeserver.db

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
6 changes: 6 additions & 0 deletions conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ location __PATH__/ {

client_max_body_size 100M;

# Use longer timeouts for the sync API
location __PATH__/client/r0/sync {
proxy_read_timeout 7m;
proxy_pass http://localhost:__PORT__;
}

# 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