aboutsummaryrefslogtreecommitdiff
path: root/weed/command/volume.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/command/volume.go')
-rw-r--r--weed/command/volume.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/command/volume.go b/weed/command/volume.go
index ad9803974..a54ffd1fd 100644
--- a/weed/command/volume.go
+++ b/weed/command/volume.go
@@ -36,6 +36,8 @@ type VolumeServerOptions struct {
indexType *string
fixJpgOrientation *bool
readRedirect *bool
+ cpuProfile *string
+ memProfile *string
}
func init() {
@@ -54,6 +56,8 @@ func init() {
v.indexType = cmdVolume.Flag.String("index", "memory", "Choose [memory|leveldb|boltdb|btree] mode for memory~performance balance.")
v.fixJpgOrientation = cmdVolume.Flag.Bool("images.fix.orientation", true, "Adjust jpg orientation when uploading.")
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")
}
var cmdVolume = &Command{
@@ -75,6 +79,7 @@ func runVolume(cmd *Command, args []string) bool {
*v.maxCpu = runtime.NumCPU()
}
runtime.GOMAXPROCS(*v.maxCpu)
+ util.SetupProfiling(*v.cpuProfile, *v.memProfile)
//Set multiple folders and each folder's max volume count limit'
v.folders = strings.Split(*volumeFolders, ",")
@@ -156,7 +161,7 @@ func runVolume(cmd *Command, args []string) bool {
}()
}
- OnInterrupt(func() {
+ util.OnInterrupt(func() {
volumeServer.Shutdown()
})