Skip to content

Performances improvements#447

Open
OniriCorpe wants to merge 4 commits into
testingfrom
libjemalloc
Open

Performances improvements#447
OniriCorpe wants to merge 4 commits into
testingfrom
libjemalloc

Conversation

@OniriCorpe

Copy link
Copy Markdown
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)

@Josue-T Josue-T left a comment

Copy link
Copy Markdown

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 ?

Comment thread conf/homeserver.yaml
# replaces the previous top-level 'use_presence' option.
#
#enabled: false
enabled: __PRESENCE__

Copy link
Copy Markdown

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__

Comment thread scripts/install

# 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
Copy Markdown

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.

Comment thread scripts/upgrade
# 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
Copy Markdown

Choose a reason for hiding this comment

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

same here

Comment thread doc/ADMIN.md
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
Copy Markdown

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