Reduce webhook delivery cleanup impact (#2550)
* Add index on webhook_deliveries.created_at The stale scope (WHERE created_at < ?) and ordered scope (ORDER BY created_at DESC) both benefit from this index. Without it, Webhook::Delivery.cleanup does a full table scan. * Run webhook delivery cleanup every 15 minutes Each run now deletes ~15 minutes of newly-stale records instead of ~4 hours worth, a 16x reduction in per-run write volume.
This commit is contained in:
@@ -20,7 +20,7 @@ production: &production
|
||||
schedule: every hour at minute 12
|
||||
cleanup_webhook_deliveries:
|
||||
command: "Webhook::Delivery.cleanup"
|
||||
schedule: every 4 hours at minute 51
|
||||
schedule: every 15 minutes
|
||||
cleanup_magic_links:
|
||||
command: "MagicLink.cleanup"
|
||||
schedule: every 4 hours
|
||||
|
||||
Reference in New Issue
Block a user