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:
Harshavardhana
2024-07-23 03:53:03 -07:00
committed by GitHub
parent c0e2886e37
commit 91805bcab6
8 changed files with 69 additions and 22 deletions

View File

@@ -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