Skip to content

Backup subcontroller's memory usage is unbounded when reconciling backupsΒ #698

@mx-sylveon

Description

@mx-sylveon

From a quick glance at the source, it appears that the subcontroller just tries to naively get and process all backups in-memory all at once. That obviously means memory usage will increase in an unbounded manner as the number of backups increases.

The issue can of course be mitigated by limiting the number of backups retained, but I think it should be obvious that backup retention configuration is something that the user should be able to make decisions on themselves.

Alternatively, you can increase the memory allocated to the subcontroller (which unfortunately currently requires adjusting the resources on the vttablets, per #661), but that is just a band-aid and would need to increase over time.

Really the subcontroller should just be handling the backups reconciliation in a paginated manner so that the memory usage is capped at a reasonable level.

Additionally, given the current design where backups are near-constantly reconciled to maintain a sync between the VitessBackups and the backups stored in the remote backup location (AWS S3, etc;), it might be prudent to update documentation to give some guidelines on backup retention and its effect on resource usage by Vitess Operator, see: the subcontroller's memory usage, the subcontroller's reconciliation loop runtime increasing as backup count increases, the build up of VitessBackup k8s resources, etc; Not to mention the cloud provider API costs associated with making so many requests to reconcile the backups constantly. Honestly, there should probably be some guidance on expected ways to use vitess-operator without incurring unnecessary cloud costs due to the design of the backup system.

To be honest, this last part might be worth an issue on it's own. πŸ˜…

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions