I once annoyed RandBot by getting him to play this on stream.me on Australia Day. Good times.
So here is what I discovered when trying to optimize my Pleroma instance so far. I've been pruning old posts for quite some time, but I never had the command pruning old activities for probably like 3 years or maybe more now. As a result, I had a build up of a ton of rows that could be cleared up. It grew so large that the command to clear up the orphaned activities you're supposed to run would never finish, so I extracted a query from that which I could LIMIT so it can delete in batches that can actually run. -- Delete orpahaned activities batch_size at a time until they are all gone. CREATE OR REPLACE PROCEDURE prune_orphaned_activities(batch_size integer) LANGUAGE plpgsql AS $$ DECLARE rows_deleted integer; BEGIN LOOP DELETE FROM public.activities WHERE id IN ( SELECT a.id FROM public.activities a LEFT JOIN public.objects o ON a.data ->> 'object' = o.data ->> 'id' LEFT JOIN public.activities a2 ON a.data ->> 'object' = a2.data ->> 'id' LEFT JOIN public.users u ON a.data ->> 'object' = u.ap_id WHERE NOT a.local AND jsonb_typeof(a.data -> 'object') = 'string' AND o.id IS NULL AND a2.id IS NULL AND u.id IS NULL LIMIT batch_size ); GET DIAGNOSTICS rows_deleted = ROW_COUNT; COMMIT; RAISE NOTICE 'deleted % rows this batch', rows_deleted; EXIT WHEN rows_deleted = 0; END LOOP; END $$; --- 10000 from random calls seems to run fast enough. CALL prune_orphaned_activities(10000); So far that's created 21,390,290 dead tuples. Probably there's tens of GB of junk lying around in this database I can remove with a full vacuum later.
I think the shit I am doing is working...
If this shit works then I am deep in Pleroma esotericism.
Gonna try some crazy shit that might fuck up. YOLOOOO
I be pruning the Hell out of Pleroma stuff. Trying to get it down to a reasonable size again.
There is a chance that if Andy Burnham resigns a mayor in order to run as an MP in the outgoing seat in Manchester that Reform could end up winning both the seat in Common and also a mayor. Please God let that happen, as that would be the most crushing defeat possible. image
Linode was doing a retarded thing where it set a disk to mount via `/dev/sdX` overriding GRUB and doesn't let you specify a UUID and of course the devices are randomly swapping letters around. I had to set it to `/dev/root` via the web interface and then update `GRUB_CMDLINE_LINUX` to specify the disk UUID so it always gets the right one or the device would just randomly fail to boot. I still like Linode. Sometimes it's too slow. For sure. Sometimes it's a little too pricey. For sure. But it is reliable, loyal.
Not once have I ever wanted a configuration file to be replaced by a new default version when upgrading Debian.
Huh. I had Erlang and Elixir installed via an extra apt repository and I swapped them with the versions that are in the official Debian packages with very close versions and it worked.