diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-07-31 09:39:48 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-07-31 09:39:48 -0700 |
| commit | f5a69a0e4423db70cffb3501c05bf5d4ed593370 (patch) | |
| tree | d70180196a429ebe5ad4f14b3f4b915f85dc71ed /weed/command/filer.go | |
| parent | 899963ac20556f6a48aad431eec8ec995e982dd3 (diff) | |
| parent | 6ba65c3382d8e6e73bfa5312ed9c04c5b17aece5 (diff) | |
| download | seaweedfs-f5a69a0e4423db70cffb3501c05bf5d4ed593370.tar.xz seaweedfs-f5a69a0e4423db70cffb3501c05bf5d4ed593370.zip | |
Merge branch 'master' into add_remote_storage
Diffstat (limited to 'weed/command/filer.go')
| -rw-r--r-- | weed/command/filer.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/weed/command/filer.go b/weed/command/filer.go index a723b4d8a..4fd2f9c72 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,8 @@ type FilerOptions struct { saveToFilerLimit *int defaultLevelDbDirectory *string concurrentUploadLimitMB *int + debug *bool + debugPort *int } func init() { @@ -73,6 +76,8 @@ 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, "serves runtime profiling data, e.g., http://localhost:<debug.port>/debug/pprof/goroutine?debug=2") + f.debugPort = cmdFiler.Flag.Int("debug.port", 6060, "http port for debugging") // start s3 on filer filerStartS3 = cmdFiler.Flag.Bool("s3", false, "whether to start S3 gateway") @@ -122,6 +127,9 @@ var cmdFiler = &Command{ } func runFiler(cmd *Command, args []string) bool { + if *f.debug { + go http.ListenAndServe(fmt.Sprintf(":%d", *f.debugPort), nil) + } util.LoadConfiguration("security", false) |
