diff options
Diffstat (limited to 'weed/command/volume.go')
| -rw-r--r-- | weed/command/volume.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/command/volume.go b/weed/command/volume.go index aa300108a..5b62a4844 100644 --- a/weed/command/volume.go +++ b/weed/command/volume.go @@ -66,6 +66,8 @@ type VolumeServerOptions struct { metricsHttpPort *int // pulseSeconds *int inflightUploadDataTimeout *time.Duration + hasSlowRead *bool + readBufferSize *int } func init() { @@ -96,6 +98,8 @@ 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, "<experimental> if true, this prevents slow reads from blocking other requests, but large file read P99 latency will increase.") + v.readBufferSize = cmdVolume.Flag.Int("readBufferSize", 1024 * 1024, "<experimental> larger values can optimize query performance but will increase some memory usage,Use with hasSlowRead normally.") } var cmdVolume = &Command{ @@ -243,6 +247,8 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v int64(*v.concurrentUploadLimitMB)*1024*1024, int64(*v.concurrentDownloadLimitMB)*1024*1024, *v.inflightUploadDataTimeout, + *v.hasSlowRead, + *v.readBufferSize, ) // starting grpc server grpcS := v.startGrpcService(volumeServer) |
