element-hq / element-hq/synapse

Shuting down a room with 4k+ users takes more than 2h

Open
#7,651 0 comments 0 reactions 0 assignees View on GitHub
A-Performance T-Enhancement Z-Help-Wanted z-p3
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

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

---

### Description

It is not actually an issue, more a painful behavior.

I tried to use the admin API to shut down a room with 4443 local members (no remote users) and 4450 state events. It worked but took 122 minutes!

Here is a screenshot showing the users joining the new roow, it is quite slow:
![2020-06-06-185221_944x713_scrot](https://user-images.githubusercontent.com/479441/83949907-f6240200-a826-11ea-896c-2c4b5ec44dde.png)

The leave rate from the previous room was similar.

I do not claim to understand exactly what happens, but this seems very long to me, in particular when we know that the API call is synchronous. I think this API should be asynchronous, like the purge history API is.

It should be noted that purging this room was surprisingly fast: it tooks only 52s.

### Steps to reproduce

I don't think anyone actually want to reproduce it, but if you do here are the steps :p

1. create a new room
2. create 4k users and make them join the room (you probably want to script that part)
3. save the room's ip
4. `curl -X POST https://`

### Version information

- **Homeserver**: cloud.cervoi.se

If not matrix.org:

- **Version**: 1.14.0

- **Install method**: apt

- **Platform**: Debian 10, PostgreSQL 11, Python 3.7.3

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.