<html><head></head><body><div>On Sun, 2021-01-17 at 11:51 +0100, Nagaraj Akkina wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>Openstack host show compute-host, shows more memory allocated to instances than actual physical memory, although the memory allocation ratio is 1.0 in nova.conf, the same is also shown in horizon dashboard hypervisor statistics. We can see this in many compute nodes in the cluster. Also these statistics does not match with free -g or cat /proc/meminfo.</div><div><br></div><div>For Example : Memory_mb</div><div><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica">| compute-node23 | (total) <span class="gmail-Apple-converted-space"> |</span><span class="gmail-Apple-converted-space"> </span>257915 |<span class="gmail-Apple-converted-space"> </span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica">| compute-node23 | (used_now) <span class="gmail-Apple-converted-space"> </span>|<span class="gmail-Apple-converted-space"> </span>271360 |<span class="gmail-Apple-converted-space"> </span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica">| compute-node23 | (used_max) <span class="gmail-Apple-converted-space"> </span>|<span class="gmail-Apple-converted-space"> </span>267264 |<span class="gmail-Apple-converted-space"> </span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica"><br></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica"><br></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica">How to avoid misleading statistics, also which statistics are actually correct?</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica"><br></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica">versions :</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica"> openstack : Stein</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica"> nova : 2:19.3.0-0ubuntu1~cloud0</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica"><br></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica">Regards,</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica">Akkina </p></div></div></blockquote><div><br></div><div>As you've noted, these statistics are generally misleading or outright incorrect. They're so often wrong, in fact, that we have removed them from the API starting with the 2.88 API microversion, which is being introduced in the next release (Wallaby). There are two suggestions. Firstly, Placement provides far better information as to the state of all the things nova knows about and should be used instead. You can find examples of how to replace this using the following link:</div><div><br></div><div><a href="https://specs.openstack.org/openstack/nova-specs/specs/wallaby/approved/modernize-os-hypervisors-api.html">https://specs.openstack.org/openstack/nova-specs/specs/wallaby/approved/modernize-os-hypervisors-api.html</a></div><div><br></div><div><div>Secondly, the fact that you have overcommit enabled and are still seeing this happen suggests you don't have enough memory reserved for non-VM processes and other overhead. This is configured using the '[DEFAULT] reserved_host_memory_mb', config option, which defaults to a mere 512MB. You may need to increase this, basing your values on the average memory consumption of the host with and without load.</div></div><div><br></div><div>For reference, the way that 'memory_mb_used' is calculated is by subtracting the total amount free memory reported via '/proc/meminfo' from the total amount of memory reported by libvirt.</div><div><br></div><div>Hope this helps,</div><div>Stephen</div><div><span></span></div></body></html>