mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-08 08:31:28 +02:00
Merge branch 'master' into bump-v1.8.1
This commit is contained in:
@@ -51,7 +51,23 @@ postgresqls
|
||||
th(style='width: 140px') CPU
|
||||
th(style='width: 130px') Memory
|
||||
th(style='width: 100px') Size
|
||||
th(style='width: 120px') Cost/Month
|
||||
th(style='width: 100px') IOPS
|
||||
th(style='width: 100px') Throughput
|
||||
th(style='width: 120px')
|
||||
.tooltip(style='width: 120px')
|
||||
| Cost/Month
|
||||
.tooltiptext
|
||||
strong Cost = MAX(CPU, Memory) + rest
|
||||
br
|
||||
| 1 CPU core : 42.09$
|
||||
br
|
||||
| 1GB memory: 10.5225$
|
||||
br
|
||||
| 1GB volume: 0.0952$
|
||||
br
|
||||
| IOPS (-3000 baseline): 0.006$
|
||||
br
|
||||
| Throughput (-125 baseline): 0.0476$
|
||||
th(stlye='width: 120px')
|
||||
|
||||
tbody
|
||||
@@ -69,6 +85,8 @@ postgresqls
|
||||
td { cpu } / { cpu_limit }
|
||||
td { memory } / { memory_limit }
|
||||
td { volume_size }
|
||||
td { iops }
|
||||
td { throughput }
|
||||
td { calcCosts(nodes, cpu, memory, volume_size, iops, throughput) }$
|
||||
|
||||
td
|
||||
@@ -132,7 +150,23 @@ postgresqls
|
||||
th(style='width: 140px') CPU
|
||||
th(style='width: 130px') Memory
|
||||
th(style='width: 100px') Size
|
||||
th(style='width: 120px') Cost/Month
|
||||
th(style='width: 100px') IOPS
|
||||
th(style='width: 100px') Throughput
|
||||
th(style='width: 120px')
|
||||
.tooltip(style='width: 120px')
|
||||
| Cost/Month
|
||||
.tooltiptext
|
||||
strong Cost = MAX(CPU, Memory) + rest
|
||||
br
|
||||
| 1 CPU core : 42.09$
|
||||
br
|
||||
| 1GB memory: 10.5225$
|
||||
br
|
||||
| 1GB volume: 0.0952$
|
||||
br
|
||||
| IOPS (-3000 baseline): 0.006$
|
||||
br
|
||||
| Throughput (-125 baseline): 0.0476$
|
||||
th(stlye='width: 120px')
|
||||
|
||||
tbody
|
||||
@@ -152,6 +186,8 @@ postgresqls
|
||||
td { cpu } / { cpu_limit }
|
||||
td { memory } / { memory_limit }
|
||||
td { volume_size }
|
||||
td { iops }
|
||||
td { throughput }
|
||||
td { calcCosts(nodes, cpu, memory, volume_size, iops, throughput) }$
|
||||
|
||||
td
|
||||
@@ -229,28 +265,44 @@ postgresqls
|
||||
|
||||
const calcCosts = this.calcCosts = (nodes, cpu, memory, disk, iops, throughput) => {
|
||||
podcount = Math.max(nodes, opts.config.min_pods)
|
||||
corecost = toCores(cpu) * opts.config.cost_core
|
||||
memorycost = toMemory(memory) * opts.config.cost_memory
|
||||
corecost = toCores(cpu) * opts.config.cost_core * 30.5 * 24
|
||||
memorycost = toMemory(memory) * opts.config.cost_memory * 30.5 * 24
|
||||
diskcost = toDisk(disk) * opts.config.cost_ebs
|
||||
iopscost = 0
|
||||
if (iops !== undefined && iops > 3000) {
|
||||
iopscost = (iops - 3000) * opts.config.cost_iops
|
||||
if (iops !== undefined && iops > opts.config.free_iops) {
|
||||
if (iops > opts.config.limit_iops) {
|
||||
iops = opts.config.limit_iops
|
||||
}
|
||||
iopscost = (iops - opts.config.free_iops) * opts.config.cost_iops
|
||||
}
|
||||
throughputcost = 0
|
||||
if (throughput !== undefined && throughput > 125) {
|
||||
throughputcost = (throughput - 125) * opts.config.cost_throughput
|
||||
if (throughput !== undefined && throughput > opts.config.free_throughput) {
|
||||
if (throughput > opts.config.limit_throughput) {
|
||||
throughput = opts.config.limit_throughput
|
||||
}
|
||||
throughputcost = (throughput - opts.config.free_throughput) * opts.config.cost_throughput
|
||||
}
|
||||
|
||||
costs = podcount * (corecost + memorycost + diskcost + iopscost + throughputcost)
|
||||
costs = podcount * (Math.max(corecost, memorycost) + diskcost + iopscost + throughputcost)
|
||||
return costs.toFixed(2)
|
||||
}
|
||||
|
||||
const toDisk = this.toDisk = value => {
|
||||
if(value.endsWith("Gi")) {
|
||||
if(value.endsWith("Mi")) {
|
||||
value = value.substring(0, value.length-2)
|
||||
value = Number(value) / 1000.
|
||||
return value
|
||||
}
|
||||
else if(value.endsWith("Gi")) {
|
||||
value = value.substring(0, value.length-2)
|
||||
value = Number(value)
|
||||
return value
|
||||
}
|
||||
else if(value.endsWith("Ti")) {
|
||||
value = value.substring(0, value.length-2)
|
||||
value = Number(value) * 1000
|
||||
return value
|
||||
}
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user