aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-11-14 22:48:54 -0800
committerChris Lu <chris.lu@gmail.com>2018-11-14 22:48:54 -0800
commit2e6a3c7b160e499d91e990d9c65dab9ff1fd6be7 (patch)
treed9f94b0f54aa9f3c1a3499e7fd4075e49d37e13c /weed/command
parentf224b9fe284eb34c4c5f5223df50db93e5fd4677 (diff)
downloadseaweedfs-2e6a3c7b160e499d91e990d9c65dab9ff1fd6be7.tar.xz
seaweedfs-2e6a3c7b160e499d91e990d9c65dab9ff1fd6be7.zip
reduce memory usage
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/mount.go6
-rw-r--r--weed/command/mount_std.go2
2 files changed, 7 insertions, 1 deletions
diff --git a/weed/command/mount.go b/weed/command/mount.go
index 952dcdfcb..3442b8e97 100644
--- a/weed/command/mount.go
+++ b/weed/command/mount.go
@@ -20,7 +20,9 @@ type MountOptions struct {
}
var (
- mountOptions MountOptions
+ mountOptions MountOptions
+ mountCpuProfile *string
+ mountMemProfile *string
)
func init() {
@@ -35,6 +37,8 @@ func init() {
mountOptions.ttlSec = cmdMount.Flag.Int("ttl", 0, "file ttl in seconds")
mountOptions.chunkSizeLimitMB = cmdMount.Flag.Int("chunkSizeLimitMB", 16, "local write buffer size, also chunk large files")
mountOptions.dataCenter = cmdMount.Flag.String("dataCenter", "", "prefer to write to the data center")
+ mountCpuProfile = cmdMount.Flag.String("cpuprofile", "", "cpu profile output file")
+ mountMemProfile = cmdMount.Flag.String("memprofile", "", "memory profile output file")
}
var cmdMount = &Command{
diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go
index 0bc0ddd53..6bb4a300e 100644
--- a/weed/command/mount_std.go
+++ b/weed/command/mount_std.go
@@ -28,6 +28,8 @@ func runMount(cmd *Command, args []string) bool {
fuse.Unmount(*mountOptions.dir)
+ util.SetupProfiling(*mountCpuProfile, *mountMemProfile)
+
c, err := fuse.Mount(
*mountOptions.dir,
fuse.VolumeName("SeaweedFS"),