mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
allow disabling O_DIRECT in certain environments for reads (#14115)
repeated reads on single large objects in HPC like workloads, need the following option to disable O_DIRECT for a more effective usage of the kernel page-cache. However this optional should be used in very specific situations only, and shouldn't be enabled on all servers. NVMe servers benefit always from keeping O_DIRECT on.
This commit is contained in:
@@ -1652,7 +1652,7 @@ func (s *xlStorage) ReadFileStream(ctx context.Context, volume, path string, off
|
||||
}
|
||||
|
||||
alignment := offset%xioutil.DirectioAlignSize == 0
|
||||
if !alignment {
|
||||
if !alignment || globalAPIConfig.isDisableODirect() {
|
||||
if err = disk.DisableDirectIO(file); err != nil {
|
||||
file.Close()
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user