Add configurable disk write speed limit for backups (#74)

* Add configurable disk write speed limit for backups
This commit is contained in:
Matthew Penner
2020-12-08 09:13:48 -07:00
committed by GitHub
parent 2d4dd05ec9
commit 8e29ffed50
4 changed files with 39 additions and 2 deletions

View File

@@ -75,6 +75,8 @@ type SystemConfiguration struct {
Sftp SftpConfiguration `yaml:"sftp"`
CrashDetection CrashDetection `yaml:"crash_detection"`
Backups Backups `yaml:"backups"`
}
type CrashDetection struct {
@@ -89,6 +91,18 @@ type CrashDetection struct {
Timeout int `default:"60" json:"timeout"`
}
type Backups struct {
// WriteLimit imposes a Disk I/O write limit on backups to the disk, this affects all
// backup drivers as the archiver must first write the file to the disk in order to
// upload it to any external storage provider.
//
// If the value is less than 1, the write speed is unlimited,
// if the value is greater than 0, the write speed is the value in MB/s.
//
// Defaults to 0 (unlimited)
WriteLimit int `default:"0" yaml:"write_limit"`
}
// Ensures that all of the system directories exist on the system. These directories are
// created so that only the owner can read the data, and no other users.
func (sc *SystemConfiguration) ConfigureDirectories() error {