diff options
| author | LHHDZ <changlin.shi@ly.com> | 2022-08-05 16:16:42 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-05 01:16:42 -0700 |
| commit | 84ec68e11af0e7ec08c188714f912955cd71759a (patch) | |
| tree | 006ee731be2ff7072d91b46006ddee184efb2314 /weed/command/filer.go | |
| parent | b278bb24d380fe8c6ea6a31e0250791abb97d807 (diff) | |
| download | seaweedfs-84ec68e11af0e7ec08c188714f912955cd71759a.tar.xz seaweedfs-84ec68e11af0e7ec08c188714f912955cd71759a.zip | |
Add download speed limit support (#3408)
Diffstat (limited to 'weed/command/filer.go')
| -rw-r--r-- | weed/command/filer.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/command/filer.go b/weed/command/filer.go index 888dc2d03..5c1e653cb 100644 --- a/weed/command/filer.go +++ b/weed/command/filer.go @@ -59,6 +59,7 @@ type FilerOptions struct { debugPort *int localSocket *string showUIDirectoryDelete *bool + downloadMaxMBps *int } func init() { @@ -87,6 +88,7 @@ func init() { f.debugPort = cmdFiler.Flag.Int("debug.port", 6060, "http port for debugging") f.localSocket = cmdFiler.Flag.String("localSocket", "", "default to /tmp/seaweedfs-filer-<port>.sock") f.showUIDirectoryDelete = cmdFiler.Flag.Bool("ui.deleteDir", true, "enable filer UI show delete directory button") + f.downloadMaxMBps = cmdFiler.Flag.Int("downloadMaxMBps", 0, "download max speed for each download request, in MB per second") // start s3 on filer filerStartS3 = cmdFiler.Flag.Bool("s3", false, "whether to start S3 gateway") @@ -239,6 +241,7 @@ func (fo *FilerOptions) startFiler() { SaveToFilerLimit: int64(*fo.saveToFilerLimit), ConcurrentUploadLimit: int64(*fo.concurrentUploadLimitMB) * 1024 * 1024, ShowUIDirectoryDelete: *fo.showUIDirectoryDelete, + DownloadMaxBytesPs: int64(*fo.downloadMaxMBps) * 1024 * 1024, }) if nfs_err != nil { glog.Fatalf("Filer startup error: %v", nfs_err) |
