matrix-org / dendrite

Dendrite is a second-generation Matrix homeserver written in Go!
https://matrix-org.github.io/dendrite/
Apache License 2.0
5.67k stars 664 forks source link

SelectOneTimeKeys takes a significant amount of time #1757

Closed normen closed 3 years ago

normen commented 3 years ago

Background information

Description

The dendrite instance - despite not being connected to other instances through rooms seems to spike the CPU and database access every 30 seconds. (60MB/s database internal traffic for a few sec) Apparently one-time keys take a significant amount of time. See attached profile.

profile.zip

My dendrite instance ran for a while since 0.3.4, I nuked the db when this started around 0.3.8.

Steps to reproduce

neilalexander commented 3 years ago
Screenshot 2021-02-08 at 21 11 11
normen commented 3 years ago

When setting up a backup for dendrite I noticed that the size of a gzipped dump of the dendrite_keyserver db is about 80MB, by far the largest db of the bunch.

As said the server is basically empty atm - but federating.

kegsay commented 3 years ago

Closing this on the basis that #1851 has helped.