VMware RHEL5来宾操作系统caching的内存版本

从我读过的所有内容中,RHEL将使用所有可用/未使用的RAM进行caching以提高性能。

但是,这在VMware环境中成为我的一个问题。 VMware(ESX4)查找来宾操作系统,让它(ESX)知道访客何时完成使用内存,以便将其提供给其他服务器。

所以可以说我有一个客人有一个分贝,dB运行一个密集的工作,它完成,现在闲置。 但是由于它caching了所有内存,VMware仍然认为dB服务器需要它,所以它不会释放需要额外RAM的web服务器使用的RAM。 当然,我可以和有RAM的客人一样住在一起,但是这浪费了一个巨大的虚拟化function,因为我所有的CPU利用率都在10%以下,据我所知,RAM利用率是75%。

有任何想法吗?

在您的示例中,从DB服务器VM回收内存的一种机制是VMware Balloon驱动程序 (它是VMware Tools的一部分):

This is VMware physical memory management driver which acts like a "balloon" that can be inflated to reclaim physical pages by reserving them in the guest and invalidating them in the monitor, freeing up the underlying machine pages so they can be allocated to other guests. The balloon can also be deflated to allow the guest to use more physical memory. 

请参阅了解VMware®ESX Server中的内存资源pipe理中的 “3.3 Ballooning” (pdf) 。

你也可以运行这个小脚本

 #!/bin/sh sync && echo 3 > /proc/sys/vm/drop_caches 

在数据库服务器虚拟机中显式释放pagecache,dentries和inode,如果你确定你不需要caching了。