matrix-synapse-cleanup/README.md

79 lines
2.6 KiB
Markdown
Raw Normal View History

2024-09-01 09:42:49 +02:00
#CLEANUP MATRIX SYNAPSE
Das script per Cronjob täglich laufen lassen.
Und von Zeit zu Zeit verbindet man sich mit der Postgresql-Datenbank als User postgres
`sudo -u postgresql psql`
Dann matrix-synapse stoppen und im Anschluss mit der Datenbank für synapse connecten
```
\c synapse
REINDEX (VERBOSE) DATABSE synapse;
VACUUM FULL VERBOSE;
```
Das reduziert die Größe der Datenbank enorm.
Anschließend wieder matrix-synapse starten.
2024-09-01 09:44:03 +02:00
Das reduzierte meine Matrix-Datenbank von
```
Sun 01 Sep 2024 08:57:33 AM CEST : relation | total_size
-------------------------------------+------------
public.state_groups_state | 12 GB
public.device_lists_changes_in_room | 1355 MB
public.received_transactions | 1200 MB
public.event_json | 867 MB
public.events | 482 MB
public.state_groups | 344 MB
public.event_edges | 281 MB
public.state_group_edges | 233 MB
public.event_auth | 212 MB
public.event_search | 171 MB
public.device_lists_stream | 138 MB
public.device_lists_remote_cache | 133 MB
public.room_memberships | 130 MB
public.e2e_cross_signing_keys | 130 MB
public.current_state_delta_stream | 110 MB
public.event_to_state_groups | 102 MB
public.receipts_linearized | 86 MB
public.event_auth_chain_links | 80 MB
public.state_events | 79 MB
public.event_auth_chains | 74 MB
```
auf
```
Sun 01 Sep 2024 09:19:29 AM CEST : relation | total_size
-------------------------------------+------------
public.state_groups_state | 5565 MB
public.device_lists_changes_in_room | 1080 MB
public.event_json | 727 MB
public.received_transactions | 560 MB
public.state_groups | 315 MB
public.events | 306 MB
public.event_edges | 192 MB
public.state_group_edges | 157 MB
public.event_auth | 145 MB
public.event_search | 130 MB
public.e2e_cross_signing_keys | 125 MB
public.device_lists_remote_cache | 110 MB
public.current_state_delta_stream | 108 MB
public.room_memberships | 81 MB
public.event_to_state_groups | 74 MB
public.device_lists_stream | 63 MB
public.event_auth_chain_links | 59 MB
public.state_events | 50 MB
public.event_auth_chains | 44 MB
public.current_state_events | 34 MB
(20 rows)
```
2024-09-01 09:42:49 +02:00
Quellen:
- https://levans.fr/shrink-synapse-database.html