Metric Extension : HugePages & capacity planning

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: 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

Capture 03

Capture 02

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 😀

Ref :

3 thoughts on “Metric Extension : HugePages & capacity planning

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s