Skip to content

fix: optimize ceph backup retention and reduce storage usage - #1546

Open
NishaSharma14 wants to merge 1 commit into
developmentfrom
issue-#1533
Open

fix: optimize ceph backup retention and reduce storage usage#1546
NishaSharma14 wants to merge 1 commit into
developmentfrom
issue-#1533

Conversation

@NishaSharma14

Copy link
Copy Markdown
Contributor
  • 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
@NishaSharma14
NishaSharma14 requested review from vcnainala and a lite review from Copilot September 4, 2026 12:01
@NishaSharma14 NishaSharma14 self-assigned this Sep 4, 2026
@NishaSharma14 NishaSharma14 linked an issue Sep 4, 2026 that may be closed by this pull request
4 tasks

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 ceph disk instead of local.
  • 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.

Comment thread config/backup.php
Comment on lines 226 to +227
'name' => env('APP_NAME', 'laravel-backup'),
'disks' => ['local'],
'disks' => ['ceph'],
Comment thread config/backup.php
* 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

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.26%. Comparing base (8681915) to head (5dfcc7e).

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           
Flag Coverage Δ
unittests 80.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean up Ceph storage to resolve quota exceed limit issue

2 participants