Project

General

Profile

Feature #10786

Cavalcade job and log cleanup

Added by Boone Gorges 9 months ago. Updated 8 months ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
Cavalcade
Target version:
Start date:
2018-12-05
Due date:
% Done:

0%

Estimated time:

Description

The cavalcade MySQL tables get very large over time, which I think contributes somewhat to performance issues. They can use periodic cleanup.

1. wp_cavalcade_logs should be purged occasionally. There's no reason to have hot storage of more than a few weeks' worth of logs. I'm currently doing it manually every couple weeks (export table, then delete everything except the last few weeks).

2. wp_cavalcade_jobs collects many jobs in the 'completed' or 'failed' status. There's generally no reason to keep these (except for debugging) and we should delete them on at least a weekly basis. https://github.com/humanmade/Cavalcade/issues/72

These tasks are easily performed via wp cli, which we could then rig up to a cron job.

cavalcade-jobs-rotate.sh (403 Bytes) cavalcade-jobs-rotate.sh Boone Gorges, 2018-12-13 11:30 AM
cavalcade-logs-rotate.sh (397 Bytes) cavalcade-logs-rotate.sh Boone Gorges, 2018-12-13 11:30 AM

History

#1 Updated by Boone Gorges 8 months ago

I decided to tackle this earlier, since it's not tied to a specific release. The two scripts are attached. They're set to run early on Sunday mornings. I'll confirm that the cron jobs are running correctly on Monday. Backups are in /home/GC/bgorges/cavalcade-backups, should we ever need them. I'll manually purge this directory once a year or so.

Also available in: Atom PDF