akrasnov-drv opened a new issue, #11120:
URL: https://github.com/apache/cloudstack/issues/11120

   ### The required feature described as a wish
   
   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 are quite easy to do (imho) and 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, 2048L);  // 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`)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to