lib/storage: consistency renaming: getMaxRawRowsPerPartition -> getMaxRawRowsPerShard

This commit is contained in:
Aliaksandr Valialkin 2021-06-11 10:52:14 +03:00
parent d06c0e7a94
commit eb335d2c29
2 changed files with 4 additions and 4 deletions

View file

@ -79,8 +79,8 @@ const finalPartsToMerge = 3
// Higher number of shards reduces CPU contention and increases the max bandwidth on multi-core systems.
var rawRowsShardsPerPartition = (cgroup.AvailableCPUs() + 7) / 8
// getMaxRowsPerPartition returns the maximum number of rows that haven't been converted into parts yet.
func getMaxRawRowsPerPartition() int {
// getMaxRawRowsPerShard returns the maximum number of rows that haven't been converted into parts yet.
func getMaxRawRowsPerShard() int {
maxRawRowsPerPartitionOnce.Do(func() {
n := memory.Allowed() / rawRowsShardsPerPartition / 256 / int(unsafe.Sizeof(rawRow{}))
if n < 1e4 {
@ -515,7 +515,7 @@ type rawRows struct {
}
func getRawRowsMaxSize() *rawRows {
size := getMaxRawRowsPerPartition()
size := getMaxRawRowsPerShard()
return getRawRowsWithSize(size)
}

View file

@ -110,7 +110,7 @@ func createBenchTable(b *testing.B, path string, startTimestamp int64, rowsPerIn
func benchmarkTableSearch(b *testing.B, rowsCount, tsidsCount, tsidsSearch int, fetchData bool) {
startTimestamp := timestampFromTime(time.Now()) - 365*24*3600*1000
rowsPerInsert := getMaxRawRowsPerPartition()
rowsPerInsert := getMaxRawRowsPerShard()
tb := openBenchTable(b, startTimestamp, rowsPerInsert, rowsCount, tsidsCount)
tr := TimeRange{