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

Synapse pegs cpu at 100% and disconnects all clients #6118

Closed
davehayes opened this issue Sep 26, 2019 · 7 comments
Closed

Synapse pegs cpu at 100% and disconnects all clients #6118

davehayes opened this issue Sep 26, 2019 · 7 comments
Labels
A-Performance Performance, both client-facing and admin-facing z-bug (Deprecated Label) z-p2 (Deprecated Label)

Comments

@davehayes
Copy link

davehayes commented Sep 26, 2019

Description

Two days in a row I have gone to read the room history for rooms I am interested in and suddenly synapse will disconnect all clients and spin 100%, filling up log files with lots of stack trace and error messages. I have attempted to extract the meaningful bits here but of course there's a big wall of log text that I may have missed:

# ls -lat
total 1082888
-rw-r-----  1 synapse  synapse   59915573 Sep 26 12:36 homeserver.log
drwxr-xr-x  2 synapse  synapse        512 Sep 26 12:19 .
-rw-r-----  1 synapse  synapse  104857584 Sep 26 12:18 homeserver.log.1
-rw-r-----  1 synapse  synapse  104857479 Sep 26 12:16 homeserver.log.2
drwxr-xr-x  8 root     wheel         3072 Sep 26 11:00 ..
-rw-r-----  1 synapse  synapse  104857252 Sep 26 07:34 homeserver.log.3

I should also mention I have encoding: utf8 in my log.config.

Steps to reproduce

  • I am unable to reproduce this

Version information

  • Homeserver:

matrix.jetcafe.org

  • Version:
# curl https://matrix.jetcafe.org:8448/_synapse/admin/v1/server_version
{
    "python_version": "3.6.9",
    "server_version": "1.2.1"
}
  • Install method:

FreeBSD ports

  • Platform:

FreeBSD 11.3 r349638, dedicated bare metal. I'm the package builder for this server so feel free to ask any questions.

@richvdh
Copy link
Member

richvdh commented Sep 26, 2019

ugh. That sounds a lot like #4240, which we never really got to the bottom of.

@davehayes
Copy link
Author

Indeed. I read that with interest. I'm wondering if there is a way I can help debug it, but this may be problematic because I build synapse through FreeBSD ports. Still, I'm the one who builds it directly (I don't use FreeBSD's official package repos) so...I'm willing to help at any rate! :D

@neilisfragile neilisfragile added z-bug (Deprecated Label) z-p2 (Deprecated Label) A-Performance Performance, both client-facing and admin-facing labels Oct 2, 2019
@seth586
Copy link

seth586 commented Feb 23, 2021

Same problem here, compiled from ports, only change was I added urlpreview to the makefile.

Happens about once a day, for now I'll just write a script to restart if CPU hits 100 ...

@clokep
Copy link
Member

clokep commented Feb 23, 2021

The first thing to check is that Synapse is up-to-date and that the logging config is up-to-date with the Synapse repo since there were some fixes in this area.

@seth586
Copy link

seth586 commented Feb 24, 2021

Good catch, although I am running v1.26.0

handlers:
    file:
        class: logging.handlers.TimedRotatingFileHandler
        formatter: precise
        filename: /var/log/matrix-synapse/homeserver.log
        when: midnight

The lockup happened roughly around midnight system UTC time, and I was writing logs to /dev/null.

To test this, what values can I substitute for midnight to represent a certain time?

Is there a more eloquent way to disable logging?

@clokep
Copy link
Member

clokep commented Feb 26, 2021

Is there a more eloquent way to disable logging?

I can't really recommend doing that, but removing all handlers will probably do that.

@richvdh
Copy link
Member

richvdh commented Apr 30, 2021

Given the lack of follow-up here, I'm going to assume the issue is fixed.

@richvdh richvdh closed this as completed Apr 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Performance Performance, both client-facing and admin-facing z-bug (Deprecated Label) z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

5 participants