Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Users stop syncing, postgres queries at high CPU #7618

Closed
@f0x52

Description

Description

At seemingly random intervals, sync totally cuts out for my account, while other users on my homeserver are able to send and receive just fine.
During this, there are multiple postgres queries related to my account, pegged at very high cpu usage:
image

from SELECT datname,query FROM pg_stat_activity where datname='synapse';, it shows that most of these are related to state groups:
This same query is being ran 8 times:

WITH RECURSIVE state(state_group) AS ( VALUES(2380548::bigint) UNION ALL SELECT prev_state_group FROM state_group_edges e, state s WHERE s.state_group = e.state_group ) SELECT DISTINCT type, state_key, last_value(event_id) OVER ( PARTITION BY type, state_key ORDER BY state_group ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS event_id FROM state_groups_state WHERE state_group IN ( SELECT state_group FROM state ) AND ((type = 'm.room.history_visibility' AND state_key = '') OR (type = 'm.room.member' AND state_key = '@f0x:pixie.town'))

Synapse logging does not seem to report anything on this.
A while after Riot drops my sync completely (Connection to server lost), performance seems to stall for other users too, most likely due to postgres being too busy.

Version information

  • Homeserver: pixie.town

If not matrix.org:

  • Version: 1.14.0

  • Install method: pip

  • Platform: Bare-metal debian sid

Metadata

Assignees

No one assigned

    Labels

    T-OtherQuestions, user support, anything else.X-Needs-InfoThis issue is blocked awaiting information from the reporter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions