element-hq / element-hq/synapse
Shuting down a room with 4k+ users takes more than 2h
- 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:

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
Assessment
This issue has not been assessed yet.