Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelogs/unreleased/9351-kvaps
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix: Enable throttling parameters in BackupRepository repositoryConfig
5 changes: 5 additions & 0 deletions pkg/repository/provider/unified_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,11 @@ func getStorageVariables(backupLocation *velerov1api.BackupStorageLocation, repo
validParams := []string{
udmrepo.StoreOptionCacheLimit,
udmrepo.StoreOptionKeyFullMaintenanceInterval,
udmrepo.ThrottleOptionReadOps,
udmrepo.ThrottleOptionWriteOps,
udmrepo.ThrottleOptionListOps,
udmrepo.ThrottleOptionUploadBytes,
udmrepo.ThrottleOptionDownloadBytes,
}
for _, param := range validParams {
if v, found := backupRepoConfig[param]; found {
Expand Down
31 changes: 31 additions & 0 deletions pkg/repository/provider/unified_repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,37 @@ func TestGetStorageVariables(t *testing.T) {
"cacheLimitMB": "1000",
},
},
{
name: "fs with throttle config",
backupLocation: velerov1api.BackupStorageLocation{
Spec: velerov1api.BackupStorageLocationSpec{
Provider: "velero.io/fs",
Config: map[string]string{
"fspath": "fake-path",
"prefix": "fake-prefix",
},
},
},
repoBackend: "fake-repo-type",
repoConfig: map[string]string{
udmrepo.ThrottleOptionUploadBytes: "838860800",
udmrepo.ThrottleOptionDownloadBytes: "838860800",
udmrepo.ThrottleOptionReadOps: "100",
udmrepo.ThrottleOptionWriteOps: "100",
udmrepo.ThrottleOptionListOps: "50",
},
expected: map[string]string{
"fspath": "fake-path",
"bucket": "",
"prefix": "fake-prefix/fake-repo-type/",
"region": "",
"ThrottleUploadBytes": "838860800",
"ThrottleDownloadBytes": "838860800",
"ThrottleReadOPS": "100",
"ThrottleWriteOPS": "100",
"ThrottleListOPS": "50",
},
},
}

for _, tc := range testCases {
Expand Down
10 changes: 5 additions & 5 deletions pkg/repository/udmrepo/repo_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ const (

StoreOptionCacheLimit = "cacheLimitMB"

ThrottleOptionReadOps = "readOPS"
ThrottleOptionWriteOps = "writeOPS"
ThrottleOptionListOps = "listOPS"
ThrottleOptionUploadBytes = "uploadBytes"
ThrottleOptionDownloadBytes = "downloadBytes"
ThrottleOptionReadOps = "ThrottleReadOPS"
Copy link
Contributor

@Lyndon-Li Lyndon-Li Dec 11, 2025

Choose a reason for hiding this comment

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

Sorry for misleading of my previous comment. We add throttle for each of the options, but as the convention, we need to make the first word lowercase, like:

    ThrottleOptionReadOps       = "throttleReadOPS"
	ThrottleOptionWriteOps      = "throttleWriteOPS"
	ThrottleOptionListOps       = "throttleListOPS"
	ThrottleOptionUploadBytes   = "throttleUploadBytes"
	ThrottleOptionDownloadBytes = "throttleDownloadBytes"

ThrottleOptionWriteOps = "ThrottleWriteOPS"
ThrottleOptionListOps = "ThrottleListOPS"
ThrottleOptionUploadBytes = "ThrottleUploadBytes"
ThrottleOptionDownloadBytes = "ThrottleDownloadBytes"
// FullMaintenanceInterval will overwrite kopia maintenance interval
// options are fastGC for 12 hours, eagerGC for 6 hours, normalGC for 24 hours
StoreOptionKeyFullMaintenanceInterval = "fullMaintenanceInterval"
Expand Down
14 changes: 13 additions & 1 deletion site/content/docs/main/backup-repository-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ data:
<kopia>: |
{
"cacheLimitMB": 2048,
"fullMaintenanceInterval": "fastGC"
"fullMaintenanceInterval": "fastGC",
"ThrottleUploadBytes": "838860800",
"ThrottleDownloadBytes": "838860800"
}
<other-repository-type>: |
{
Expand Down Expand Up @@ -59,5 +61,15 @@ Per kopia [Maintenance Safety](https://kopia.io/docs/advanced/maintenance/#maint

On the other hand, the not-in-use data will be deleted permanently after the full maintenance, so shorter full maintenance intervals may weaken the data safety if they are used incorrectly.

`ThrottleUploadBytes`: specifies the maximum upload speed in bytes per second for the repository. This can be used to throttle the upload bandwidth. The value should be specified as a string representing bytes per second (e.g., "838860800" for ~800 MB/s). This parameter applies during repository operations that write data.

`ThrottleDownloadBytes`: specifies the maximum download speed in bytes per second for the repository. This can be used to throttle the download bandwidth. The value should be specified as a string representing bytes per second (e.g., "838860800" for ~800 MB/s). This parameter applies during repository operations that read data.

`ThrottleReadOPS`: specifies the maximum number of read operations per second. This can be used to throttle the rate of read operations to the storage backend.

`ThrottleWriteOPS`: specifies the maximum number of write operations per second. This can be used to throttle the rate of write operations to the storage backend.

`ThrottleListOPS`: specifies the maximum number of list operations per second. This can be used to throttle the rate of list operations to the storage backend.

[1]: file-system-backup.md
[2]: csi-snapshot-data-movement.md