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

Performances improvements #447

Open
wants to merge 4 commits into
base: testing
Choose a base branch
from
Open

Performances improvements #447

wants to merge 4 commits into from

Conversation

OniriCorpe
Copy link
Member

Problem

  • on my server, synapse is slow

Solution

after that my server is much more usable
so i modified the package to implement the libjemalloc thing
also implemented presence tracking deactivation, since the docs says that it can be the culprit

PR Status

  • Code finished and ready to be reviewed/tested
  • The fix/enhancement were manually tested (if applicable)

Copy link

@Josue-T Josue-T left a comment

Choose a reason for hiding this comment

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

Thanks for the pull request.
A small question: did you see any perf improvement after enabling the libjemalloc lib ?

@@ -97,7 +97,7 @@ presence:
# Uncomment to disable presence tracking on this homeserver. This option
# replaces the previous top-level 'use_presence' option.
#
#enabled: false
enabled: __PRESENCE__
Copy link

Choose a reason for hiding this comment

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

Suggested change
enabled: __PRESENCE__
enabled: __PRESENCE_TRACKING__

@@ -196,6 +198,10 @@ ynh_add_systemd_config --service=$app --template=synapse.service
cp ../conf/default_coturn /etc/default/coturn-$app
ynh_add_systemd_config --service=$app-coturn --template=synapse-coturn.service

# add libjemalloc.so to the matrix-synapse env file
libjemalloc_path=$(whereis libjemalloc | cut -d ' ' -f 3)
echo "LD_PRELOAD=$libjemalloc_path" >> "/etc/default/matrix-$app"
Copy link

Choose a reason for hiding this comment

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

Well as this app is packaged with pip I really prefer to keep all config into /etc/matrix-$app/.

Same a the last comment we should add this into a template file which will be in /etc/matrix-$app/synapse_env.

# if necessary, add libjemalloc.so to the matrix-synapse env file
if ! grep -q "libjemalloc" "/etc/default/matrix-$app"; then
libjemalloc_path=$(whereis libjemalloc | cut -d ' ' -f 3)
echo "LD_PRELOAD=$libjemalloc_path" >> "/etc/default/matrix-$app"
Copy link

Choose a reason for hiding this comment

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

same here

If your server is slow, you can do the following, according to [the official doc](https://matrix-org.github.io/synapse/latest/usage/administration/admin_faq.html#help-synapse-is-slow-and-eats-all-my-ramcpu):

- increase the `SYNAPSE_CACHE_FACTOR` value in your `/etc/default/matrix-__APP__`, `2` is a good value
- note that the counterpart is more RAM usage
Copy link

Choose a reason for hiding this comment

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

well this file is not managed by synapse. We should create a template file which will be in /etc/matrix-$app/synapse_env (and declare the usage in systemd unit). And manage synapse cache factor from config panel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants