aboutsummaryrefslogtreecommitdiff
path: root/weed/command/volume.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-05-03 17:22:39 -0700
committerChris Lu <chris.lu@gmail.com>2019-05-03 17:22:39 -0700
commitb335f81a4fb51e57b0da37b2b662e823369459f6 (patch)
tree7eeb6af906d81bf1a67aae1b9f627464f355908c /weed/command/volume.go
parentf0f981e7c8bd74f3df277539407bcb6b6a483050 (diff)
downloadseaweedfs-b335f81a4fb51e57b0da37b2b662e823369459f6.tar.xz
seaweedfs-b335f81a4fb51e57b0da37b2b662e823369459f6.zip
volume: add option to limit compaction speed
Diffstat (limited to 'weed/command/volume.go')
-rw-r--r--weed/command/volume.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/command/volume.go b/weed/command/volume.go
index b87555456..4d34fbc1e 100644
--- a/weed/command/volume.go
+++ b/weed/command/volume.go
@@ -43,6 +43,7 @@ type VolumeServerOptions struct {
readRedirect *bool
cpuProfile *string
memProfile *string
+ compactionMBPerSecond *int
}
func init() {
@@ -63,6 +64,7 @@ func init() {
v.readRedirect = cmdVolume.Flag.Bool("read.redirect", true, "Redirect moved or non-local volumes.")
v.cpuProfile = cmdVolume.Flag.String("cpuprofile", "", "cpu profile output file")
v.memProfile = cmdVolume.Flag.String("memprofile", "", "memory profile output file")
+ v.compactionMBPerSecond = cmdVolume.Flag.Int("compactionMBps", 0, "limit compaction speed in mega bytes per second")
}
var cmdVolume = &Command{
@@ -157,6 +159,7 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v
strings.Split(masters, ","), *v.pulseSeconds, *v.dataCenter, *v.rack,
v.whiteList,
*v.fixJpgOrientation, *v.readRedirect,
+ *v.compactionMBPerSecond,
)
listeningAddress := *v.bindIp + ":" + strconv.Itoa(*v.port)