You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use hugepages and some other tweaks to optimize performance of KVM VMs.
I managed to use our KVM VM config in CloudStack by updating VM xml via hook.
The problem is that CloudStack checks free memory of Linux and ignores free hugepages.
As I understand, in the earlier version of CloudStack it used shell to get free memory info, but now it uses Java calls that I can't change without patching and rebuilding agent code.
The following changes should do what I miss:
I'd like to have config option (in Cloudstack config, or in agent.properties) to enable hugepages (defaults to off). IMHO, it's quite easy to do. The option will
add the following block to each KVM VM created
<memoryBacking>
<hugepages/>
</memoryBacking>
change check of free memory from MemFree to HugePages_Free × Hugepagesize
Something like the following
long hpFree = map.getOrDefault(HUGEPAGE_FREE_KEY, 0L);
long hpSize = map.getOrDefault(HUGEPAGE_SIZE_KEY, 1024L); // KiB
return (hpFree * hpSize) + memFree;
Another option, though less preferable, is to allow using external script (e.g. host.stats.command.script) to override internally acquired values (e.g. MemFree)
Activity
NuxRo commentedon Jul 10, 2025
@akrasnov-drv this can be done with extra config
https://www.shapeblue.com/cloudstack-feature-first-look-enable-sending-of-arbitrary-configuration-data-to-vms/