fix: optimize ceph backup retention and reduce storage usage - #1546
fix: optimize ceph backup retention and reduce storage usage#1546NishaSharma14 wants to merge 1 commit into
Conversation
NishaSharma14
commented
Sep 4, 2026
- enable gzip compression for PostgreSQL dumps
- keep daily backups database-only
- monitor the actual Ceph backup disk
- tighten retention with weekly/monthly pruning and max storage cap
- enable gzip compression for PostgreSQL dumps - keep daily backups database-only - monitor the actual Ceph backup disk - tighten retention with weekly/monthly pruning and max storage cap
There was a problem hiding this comment.
🟡 Changes recommended
Backup monitoring configuration appears inconsistent with the backup naming/prefix (and storage thresholds drift), which can cause incorrect health check results.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the Spatie Laravel Backup configuration to reduce Ceph storage usage by compressing PostgreSQL dumps, focusing backups on database dumps, and tightening retention/cleanup limits.
Changes:
- Enable gzip compression for database dumps.
- Monitor backups on the
cephdisk instead oflocal. - Adjust cleanup strategy to retain weekly/monthly snapshots and enforce a max storage cap via
BACKUP_MAX_STORAGE_MB.
File summaries
| File | Description |
|---|---|
| config/backup.php | Switches DB dump compression on, targets Ceph for monitoring, and tightens retention/cleanup thresholds to limit storage growth. |
Review details
Suppressed comments (1)
config/backup.php:231
- The monitor storage limit (5000 MB) is now out of sync with the cleanup hard cap (
BACKUP_MAX_STORAGE_MB, default 4096). Using the same env-driven value for both avoids configuration drift and makes alerts meaningful (i.e., cleanup should keep usage below the monitor threshold).
'disks' => ['ceph'],
'health_checks' => [
MaximumAgeInDays::class => 1,
MaximumStorageInMegabytes::class => 5000,
],
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| 'name' => env('APP_NAME', 'laravel-backup'), | ||
| 'disks' => ['local'], | ||
| 'disks' => ['ceph'], |
| * this amount of megabytes has been reached. | ||
| */ | ||
| 'delete_oldest_backups_when_using_more_megabytes_than' => null, | ||
| 'delete_oldest_backups_when_using_more_megabytes_than' => (int) env('BACKUP_MAX_STORAGE_MB', 4096), |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #1546 +/- ##
==============================================
Coverage 80.26% 80.26%
Complexity 4481 4481
==============================================
Files 293 293
Lines 16424 16424
==============================================
Hits 13182 13182
Misses 3242 3242
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|