Skip to content

nasbackup.sh: add bandwidth throttle via -b flag#12846

Open
jmsperu wants to merge 1 commit intoapache:4.20from
jmsperu:fix/nasbackup-bandwidth-throttle
Open

nasbackup.sh: add bandwidth throttle via -b flag#12846
jmsperu wants to merge 1 commit intoapache:4.20from
jmsperu:fix/nasbackup-bandwidth-throttle

Conversation

@jmsperu
Copy link

@jmsperu jmsperu commented Mar 17, 2026

Summary

  • Add -b/--bandwidth flag (MiB/s) to limit backup I/O impact on production workloads
  • Running VMs: throttles QEMU push backup via virsh blockjob --bandwidth per disk
  • Stopped VMs: uses qemu-img convert -r rate limit + ionice -c 3 (idle I/O class)
  • No bandwidth limit by default — existing behavior preserved

Motivation

Backup jobs on shared storage can saturate I/O bandwidth and degrade performance for production VMs on the same host or NAS. This is especially problematic during business hours or when multiple VMs are being backed up concurrently.

The bandwidth limit can be passed by the CloudStack agent based on a global or per-repository setting, giving admins control over backup impact.

Test plan

  • Backup without -b — verify no throttling, identical to current behavior
  • Backup running VM with -b 50 — verify blockjob --bandwidth applied, check domjobinfo shows throttled rate
  • Backup stopped VM with -b 50 — verify ionice -c 3 and -r 50M in process list
  • Verify backup completes successfully with throttling enabled

Add -b/--bandwidth flag (MiB/s) to limit backup I/O impact on
production workloads.

For running VMs: uses virsh blockjob --bandwidth to throttle the
QEMU push backup job per disk.
For stopped VMs: uses qemu-img convert -r rate limit and ionice -c 3
(idle I/O class) to minimize impact on other VMs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant