For big database servers (used for consolidating multiple databases) with a lot of memory and a lot of preallocated free HugePages it’s important to take into consideration the number of free HugePage for capacity planning .
The default “memory used” metric calculated as (MemTotal – (MemFree + Buffers + Cached)) and as (MemTotal – (MemFree – Buffers – Cached – Slab)) in recent version as shown by the free command (Ref: https://access.redhat.com/solutions/406773) don’t take into consideration the amount of Free HugePages. Using the metric extension feature of cloud control we can easily alleviate that.
For example we can use the following formula to check if the amount of memory used (including the swapped part) by all the running databases and the operating system (Excluding reclaimable memory such as the pagecache ) fit into the physical memory ( we are not taking the used pagesize into consideration here so the “vm.nr_hugepages” may need to be adjusted ) :
(MemTotal – MemFree – Buffers – Cached – HugePages_Free + SwapTotal – SwapFree – SwapCached) / MemTotal * 100
or Use "MemAvailable
” if possible :
(MemTotal – MemFree – MemAvailable – HugePages_Free + SwapTotal – SwapFree – SwapCached) / MemTotal * 100
awk '{a[$1]=$2} END{ if ( a["MemAvailable:"]=="" ) { free=a["MemFree:"] + a["Buffers:"] + a["Cached:"] + (a["HugePages_Free:"]*2048) } else { free=a["MemAvailable:"] + (a["HugePages_Free:"]*2048) } printf("%d", (a["MemTotal:"] - free + a["SwapTotal:"] - a["SwapFree:"] - a["SwapCached:"]) / a["MemTotal:"] * 100) }' /proc/meminfo
Or we cloud just build a separate metric for monitoring HugePages ! Anyway we can use the Metric Extension to build the KPIs that better fit our needs.
That’s it 😀
[…] then what ? .. Build a Metric Extension based on that formula for example (such as on my previous blog post) […]
[…] my previous blog posts Metric Extension : HugePages & capacity planning and Metric Extension : CPU usage and capacity planning we have seen haw to improve some of the […]
Is this a typo or a pun? 🙂
“Or we cloud just build a separate metric for monitoring HugePages !”