aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-07-31 02:00:01 -0700
committerChris Lu <chris.lu@gmail.com>2021-07-31 02:00:01 -0700
commit0d6f45cb464e2dc91dc392447f7af23c744a119d (patch)
tree81c50ba85e5ca9462af96a080d3a9432f6cc17f0 /weed/command/filer.go
parenta3290faf17cccc0ed22486e391953afe04dec6b9 (diff)
downloadseaweedfs-0d6f45cb464e2dc91dc392447f7af23c744a119d.tar.xz
seaweedfs-0d6f45cb464e2dc91dc392447f7af23c744a119d.zip
add debug option to generate full goroutine stack dump
Diffstat (limited to 'weed/command/filer.go')
-rw-r--r--weed/command/filer.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/command/filer.go b/weed/command/filer.go
index a723b4d8a..eb7078a9d 100644
--- a/weed/command/filer.go
+++ b/weed/command/filer.go
@@ -3,6 +3,7 @@ package command
import (
"fmt"
"net/http"
+ _ "net/http/pprof"
"os"
"strconv"
"strings"
@@ -50,6 +51,7 @@ type FilerOptions struct {
saveToFilerLimit *int
defaultLevelDbDirectory *string
concurrentUploadLimitMB *int
+ debug *bool
}
func init() {
@@ -73,6 +75,7 @@ func init() {
f.saveToFilerLimit = cmdFiler.Flag.Int("saveToFilerLimit", 0, "files smaller than this limit will be saved in filer store")
f.defaultLevelDbDirectory = cmdFiler.Flag.String("defaultStoreDir", ".", "if filer.toml is empty, use an embedded filer store in the directory")
f.concurrentUploadLimitMB = cmdFiler.Flag.Int("concurrentUploadLimitMB", 128, "limit total concurrent upload size")
+ f.debug = cmdFiler.Flag.Bool("debug", false, "generate full goroutine stack dump http://localhost:6060/debug/pprof/goroutine?debug=2")
// start s3 on filer
filerStartS3 = cmdFiler.Flag.Bool("s3", false, "whether to start S3 gateway")
@@ -122,6 +125,9 @@ var cmdFiler = &Command{
}
func runFiler(cmd *Command, args []string) bool {
+ if *f.debug {
+ go http.ListenAndServe("localhost:6060", nil)
+ }
util.LoadConfiguration("security", false)