diff options
| author | chrislu <chris.lu@gmail.com> | 2022-09-15 03:11:32 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-09-15 03:11:32 -0700 |
| commit | 896a85d6e4858a48018fcb7fc41026fcb3861dea (patch) | |
| tree | c104b8952796015daccd4e7e2b931ad7ce259d77 /weed/command/volume.go | |
| parent | 21c058790010aa9224568248f2d9bf9c324b6747 (diff) | |
| download | seaweedfs-896a85d6e4858a48018fcb7fc41026fcb3861dea.tar.xz seaweedfs-896a85d6e4858a48018fcb7fc41026fcb3861dea.zip | |
volume: add "hasSlowRead" option to customize read optimization
Diffstat (limited to 'weed/command/volume.go')
| -rw-r--r-- | weed/command/volume.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/command/volume.go b/weed/command/volume.go index aa300108a..2e62921ca 100644 --- a/weed/command/volume.go +++ b/weed/command/volume.go @@ -66,6 +66,7 @@ type VolumeServerOptions struct { metricsHttpPort *int // pulseSeconds *int inflightUploadDataTimeout *time.Duration + hasSlowRead *bool } func init() { @@ -96,6 +97,7 @@ func init() { v.metricsHttpPort = cmdVolume.Flag.Int("metricsPort", 0, "Prometheus metrics listen port") v.idxFolder = cmdVolume.Flag.String("dir.idx", "", "directory to store .idx files") v.inflightUploadDataTimeout = cmdVolume.Flag.Duration("inflightUploadDataTimeout", 60*time.Second, "inflight upload data wait timeout of volume servers") + v.hasSlowRead = cmdVolume.Flag.Bool("hasSlowRead", false, "if true, this prevents slow reads from blocking other requests, but large file read P99 latency will increase.") } var cmdVolume = &Command{ @@ -243,6 +245,7 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v int64(*v.concurrentUploadLimitMB)*1024*1024, int64(*v.concurrentDownloadLimitMB)*1024*1024, *v.inflightUploadDataTimeout, + *v.hasSlowRead, ) // starting grpc server grpcS := v.startGrpcService(volumeServer) |
