jointakahe/takahe

Timeline/Database trimming

Closed this issue · 5 comments

rcarmo commented

It would be nice to have admin features to trim the timeline (and tracked identities) to the last year, month, etc. to manage resource allocations on small servers -- both for local and remote posts, although I'm not sure if the distinction would be easy to make.

Yeah, this has been on my list of things to do for a while - I also want it as an option for local posts, but that's likely going to be less used than the one for remote posts.

Essentially, it's two pieces of work:

  • Trim local copies of posts and their timeline events past a certain horizon
  • Trim remote identities who no longer have any local posts or follows.
rcarmo commented

Any news on this? Kind of running out of disk space.

It's lower priority than some other issues, unfortunately, so I've not got to looking at it recently. I'll take a look this weekend to see if there's any easy wins.

OK, I've landed some basic post trimming on main, defaulting to the last 90 days - there's docs in there for it too, but in short, you can set TAKAHE_REMOTE_PRUNE_HORIZON to the number of days of remote content you want to keep, or 0 to disable.

Identities will be a bit trickier, but they'd need post pruning to run first anyway, so it made sense to do this first.

This has now been implemented as pruneposts and pruneidentities management commands - there's more details in our Tuning docs.