element-hq / element-hq/synapse

Add logging to determine the source of slow database transactions

Open
#13,964 0 comments 0 reactions 0 assignees View on GitHub
A-Database A-Logging T-Task
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#13964](https://github.com/matrix-org/synapse/issues/13964).

---

As a part of the [work](https://github.com/matrix-org/synapse/issues/13965) to speed up local room joins, I have been tracing joins to #synapse-dev on matrix.org, and noticed that in the slower traces there are database transactions that seem to have paused, or are spending a large and unusual amount of time where it would not be expected, eg:
![weird_pause_ex_1](https://user-images.githubusercontent.com/15820924/193159478-fc839a7c-9239-47df-80e8-2efd9dc7b7a8.png)
Add logging to get more insight into where the time is going in these cases.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the database transactions involved in the local room join work and compare the slower traces described in the issue. Add logging that identifies where unusually long pauses or unexpected transaction time are spent; done means the logs reveal the source of the slow segments.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.