You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
When I purge the history of a room (with the admin API) on my homeserver, the locally stored media is not deleted.
This is a severe problem for people like me, who try to maintain a small homeserver. I want to purge the history of image-heavy rooms on a regular basis, to free up memory.
In my opinion it makes no sense to keep the pictures in any way anyway (from purged events). Since there is no real reference to them anymore, they are just dangling files, which occupy uselessly memory.
Steps to reproduce
du -sb /opt/synapse/media_store/ returns 3,331,432,273 Bytes
select count(*) from local_media_repository; returns 1,577 entires
Upload picture to (unencrypted) room
du -sb /opt/synapse/media_store/ returns 3,333,367,545 Bytes
select count(*) from local_media_repository; returns 1,579 entries
The reason that it doesn't just do this today is that it is not straight forward to determine definitively if a given piece of media can be safely removed since it may be referenced by multiple rooms. For instance stickers from a sticker pack are duplicated for each room.
I don't quite understand the difficulty here.
You can distinguish if the media is a sticker if the msgtype is m.sticker. And an image would be m.image. Or not?
We made synapse-purge to purge remote media cache, local media and events in all rooms (both encrypted and unencrypted) until "x seconds ago" for the Synapse server, feel free to use it. It is highly configurable and should work on all instances using a Postgres database. This also preserves only the most recent user and room avatars and will remove old ones.
Description
When I purge the history of a room (with the admin API) on my homeserver, the locally stored media is not deleted.
This is a severe problem for people like me, who try to maintain a small homeserver. I want to purge the history of image-heavy rooms on a regular basis, to free up memory.
In my opinion it makes no sense to keep the pictures in any way anyway (from purged events). Since there is no real reference to them anymore, they are just dangling files, which occupy uselessly memory.
Steps to reproduce
du -sb /opt/synapse/media_store/
returns 3,331,432,273 Bytesselect count(*) from local_media_repository;
returns 1,577 entiresdu -sb /opt/synapse/media_store/
returns 3,333,367,545 Bytesselect count(*) from local_media_repository;
returns 1,579 entriesPOST /_synapse/admin/v1/purge_history/<room_id>[/<event_id>]
Purge finishes with no errors and returns a purge_id.
If I call the purge status query it says:
du -sb /opt/synapse/media_store/
still returns 3,333,367,545 Bytesselect count(*) from local_media_repository;
still returns 1,579 entriesFrom the purge_history admin API, I expect that it:
Version information
If not matrix.org:
Version: v1.2.1 avhost docker
Install method:
docker-compose up -d
The text was updated successfully, but these errors were encountered: