volume: add "readBufSize" option to customize read optimization (#3702)
* simplify a bit
* feat: volume: add "readBufSize" option to customize read optimization
* refactor : redbufSIze -> readBufferSize
* simplify a bit
* simplify a bit
serverOptions.v.idxFolder=cmdServer.Flag.String("volume.dir.idx","","directory to store .idx files")
serverOptions.v.idxFolder=cmdServer.Flag.String("volume.dir.idx","","directory to store .idx files")
serverOptions.v.inflightUploadDataTimeout=cmdServer.Flag.Duration("volume.inflightUploadDataTimeout",60*time.Second,"inflight upload data wait timeout of volume servers")
serverOptions.v.inflightUploadDataTimeout=cmdServer.Flag.Duration("volume.inflightUploadDataTimeout",60*time.Second,"inflight upload data wait timeout of volume servers")
serverOptions.v.hasSlowRead=cmdServer.Flag.Bool("volume.hasSlowRead",false,"<experimental> if true, this prevents slow reads from blocking other requests, but large file read P99 latency will increase.")
serverOptions.v.hasSlowRead=cmdServer.Flag.Bool("volume.hasSlowRead",false,"<experimental> if true, this prevents slow reads from blocking other requests, but large file read P99 latency will increase.")
serverOptions.v.readBufferSize=cmdServer.Flag.Int("volume.readBufferSize",1024*1024,"<experimental> larger values can optimize query performance but will increase some memory usage,Use with hasSlowRead normally")
s3Options.port=cmdServer.Flag.Int("s3.port",8333,"s3 server http listen port")
s3Options.port=cmdServer.Flag.Int("s3.port",8333,"s3 server http listen port")
s3Options.portGrpc=cmdServer.Flag.Int("s3.port.grpc",0,"s3 server grpc listen port")
s3Options.portGrpc=cmdServer.Flag.Int("s3.port.grpc",0,"s3 server grpc listen port")
@ -67,6 +67,7 @@ type VolumeServerOptions struct {
// pulseSeconds *int
// pulseSeconds *int
inflightUploadDataTimeout*time.Duration
inflightUploadDataTimeout*time.Duration
hasSlowRead*bool
hasSlowRead*bool
readBufferSize*int
}
}
funcinit(){
funcinit(){
@ -98,6 +99,7 @@ func init() {
v.idxFolder=cmdVolume.Flag.String("dir.idx","","directory to store .idx files")
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.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.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.")
}
}
varcmdVolume=&Command{
varcmdVolume=&Command{
@ -246,6 +248,7 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v