Sizing Tool: Set the minimum replias to 3. (#8329)

pull/8349/head
Karsten Jeschkies 2 years ago committed by GitHub
parent c638d924af
commit b179bd3381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      pkg/sizing/algorithm.go
  2. 14
      pkg/sizing/algorithm_test.go

@ -28,6 +28,9 @@ func calculateClusterSize(nt NodeType, bytesDayIngest float64, qperf QueryPerf)
bytesSecondIngest := bytesDayIngest / 86400
numWriteReplicasNeeded := math.Ceil(bytesSecondIngest / nt.writePod.rateBytesSecond)
// High availability requires at least 3 replicas.
numWriteReplicasNeeded = math.Max(3, numWriteReplicasNeeded)
//Hack based on current 4-1 mem to cpu ratio and base machine w/ 4 cores and 1 write/read
writeReplicasPerNode := float64(nt.cores / 4)
fullyWritePackedNodes := math.Floor(numWriteReplicasNeeded / writeReplicasPerNode)
@ -61,6 +64,10 @@ func calculateClusterSize(nt NodeType, bytesDayIngest float64, qperf QueryPerf)
actualReadReplicasAdded := actualNodesAddedForReads * readReplicasPerEmptyNode
totalReadReplicas := actualReadReplicasAdded + baselineReadReplicas
// High availability requires at least 3 replicas.
totalReadReplicas = math.Max(3, totalReadReplicas)
totalReadThroughputBytesSec := totalReadReplicas * nt.readPod.rateBytesSecond
totalNodesNeeded := nodesNeededForWrites + actualNodesAddedForReads

@ -50,3 +50,17 @@ func Test_CoresNodeInvariant(t *testing.T) {
}
}
}
func Test_MinimumReplicas(t *testing.T) {
for _, queryPerformance := range []QueryPerf{Basic, Super} {
for _, ingest := range []float64{1, 1000} {
for _, cloud := range NodeTypesByProvider {
for _, node := range cloud {
size := calculateClusterSize(node, ingest, queryPerformance)
require.GreaterOrEqual(t, size.TotalReadReplicas, 3)
require.GreaterOrEqual(t, size.TotalWriteReplicas, 3)
}
}
}
}
}

Loading…
Cancel
Save