Skip to content

Commit 08430fc

Browse files
authored
Adding better calibration for the gcache in memory footprint based load type (#20)
1 parent e7d8b20 commit 08430fc

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/mysqloperatorcalculator/Configuration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
// Constants
1111
// ***********************************
1212
const (
13-
VERSION = "v1.8.0"
13+
VERSION = "v1.9.0"
1414

1515
OkI = 1001
1616
ClosetolimitI = 2001

src/mysqloperatorcalculator/configurator.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,17 @@ func (c *Configurator) filterByMySQLVersion() map[string]Family {
270270
// calculate gcache effects on memory (estimation)
271271
func (c *Configurator) getGcache() {
272272
c.reference.gcache = int64(float64(c.reference.innodbRedoLogDim) * c.reference.gcacheLoad)
273-
c.reference.gcacheFootprint = int64(math.Ceil(float64(c.reference.gcache) * 0.3))
273+
// Calculating the Gcache footprint based on the load factor and load type
274+
gcacheFootPrintFactor := 0.3
275+
switch c.reference.loadID {
276+
case 1:
277+
gcacheFootPrintFactor = gcacheFootPrintFactor
278+
case 2:
279+
gcacheFootPrintFactor = 0.4
280+
case 3:
281+
gcacheFootPrintFactor = 0.6
282+
}
283+
c.reference.gcacheFootprint = int64(math.Ceil(float64(c.reference.gcache) * gcacheFootPrintFactor))
274284
c.reference.memoryLeftover -= c.reference.gcacheFootprint
275285
}
276286

0 commit comments

Comments
 (0)