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

Synapse database maintenance tools

Pedro hates github.com edited this page Apr 14, 2020 · 19 revisions

List of useful tools and scripts for maintenance Synapse database:

The purge remote media API allows server admins to purge old cached remote media.

Purge local media

There is no purge API for local media because you may be the only one with a copy. If you are sure you want to delete local media you could use something like the following to delete media that hasn't been accessed in a while.

find /path/to/synapse/media_store -atime +365 -delete This will delete media that hasn't been accessed in 365 days.

The purge history API allows server admins to purge historic events from their database, reclaiming disk space.

Cleans a synapse Postgres database of deleted messages and abandoned rooms.

Delete images and thumbnails created by URL previews in Synapse

NOTE: This is not required anymore as of Synapse 0.24, it now deletes those images by itself.

Tool for compressing (deduplicating) state_groups_state table.

Some easy SQL queries that reports useful stat about Matrix Synapse database.