mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
add optimizations to bring performance on unversioned READS (#20128)
allow non-inlined on disk to be inlined via an unversioned ReadVersion() call, we only need ReadXL() to resolve objects with multiple versions only. The choice of this block makes it to be dynamic and chosen by the user via `mc admin config set` Other bonus things - Start measuring internode TTFB performance. - Set TCP_NODELAY, TCP_CORK for low latency
This commit is contained in:
@@ -264,6 +264,24 @@ type FileInfo struct {
|
||||
Versioned bool `msg:"vs"`
|
||||
}
|
||||
|
||||
func (fi FileInfo) shardSize() int64 {
|
||||
return ceilFrac(fi.Erasure.BlockSize, int64(fi.Erasure.DataBlocks))
|
||||
}
|
||||
|
||||
// ShardFileSize - returns final erasure size from original size.
|
||||
func (fi FileInfo) ShardFileSize(totalLength int64) int64 {
|
||||
if totalLength == 0 {
|
||||
return 0
|
||||
}
|
||||
if totalLength == -1 {
|
||||
return -1
|
||||
}
|
||||
numShards := totalLength / fi.Erasure.BlockSize
|
||||
lastBlockSize := totalLength % fi.Erasure.BlockSize
|
||||
lastShardSize := ceilFrac(lastBlockSize, int64(fi.Erasure.DataBlocks))
|
||||
return numShards*fi.shardSize() + lastShardSize
|
||||
}
|
||||
|
||||
// ShallowCopy - copies minimal information for READ MRF checks.
|
||||
func (fi FileInfo) ShallowCopy() (n FileInfo) {
|
||||
n.Volume = fi.Volume
|
||||
|
||||
Reference in New Issue
Block a user