TL;DR
This paper introduces "Memory Buddies," a system that intelligently places virtual machines (VMs) on the same physical hosts to maximize memory page sharing, a feature already present in hypervisors like VMware ESX. By analyzing VM memory "fingerprints," Memory Buddies can predict sharing potential, leading to a significant increase in data center capacity and reduced resource waste.
What Problem Does This Paper Address?
Modern data centers increasingly rely on virtualization, using hypervisors like VMware ESX to run multiple virtual machines (VMs) on a single physical server. A key feature of these hypervisors is "content-based page sharing" (CBPS), which identifies and consolidates identical memory pages across VMs running on the same physical host, thereby reducing overall memory consumption. However, this sharing is limited to VMs on the same host. In a large data center with VMs spread across many physical servers, opportunities for sharing identical memory pages are missed if those VMs are not co-located. This leads to inefficient resource utilization and limits the number of VMs that can be supported. The problem Memory Buddies addresses is how to intelligently place VMs to maximize the benefits of CBPS across an entire data center, not just within a single host.
Methods
Memory Buddies tackles this problem with a two-pronged approach:
- Memory Fingerprinting: The core innovation is a system for creating compact "fingerprints" of VM memory content. These fingerprints allow for efficient comparison to estimate the potential for page sharing between VMs. Two methods are proposed:
- Hash Lists: A straightforward approach where unique page hashes are collected and stored. This provides accurate sharing estimates but can be large and computationally intensive to compare.
- Bloom Filters: A more space-efficient, probabilistic data structure. While it introduces a small error rate, Bloom filters are significantly smaller and faster to compare, making them suitable for large-scale deployments. The paper details how to compare Bloom filters to estimate the intersection of their key sets, providing a good approximation of shared pages.
- Smart Colocation Algorithm: This algorithm uses the memory fingerprints to guide VM placement.
- Initial Placement: When a new VM arrives, the algorithm identifies feasible hosts and selects the one that offers the highest predicted page sharing potential with existing VMs.
- Server Consolidation: The system can also identify underutilized servers and migrate their VMs to other hosts to consolidate resources, powered off servers, and save energy. This process also leverages the sharing potential to optimize packing.
- Hotspot Mitigation: Memory Buddies monitors for changes in VM behavior that might reduce page sharing (e.g., application phase changes), leading to increased memory pressure. When detected, it can trigger migrations to re-balance the load and restore sharing opportunities.
Datasets
The paper utilizes several datasets for evaluation:
- Real-world Memory Traces: The authors collected memory traces from over 30 Linux, Mac OS X, and Windows systems within their department. These traces were used to analyze actual page sharing potential across diverse machines and to drive simulations.
- Prototype Data Center Experiments: A testbed was set up with VMware ESX Server running several realistic applications:
- RUBiS: An eBay-like auction web application.
- TPC-W: An e-commerce website benchmark.
- SpecJBB 2005: A Java-based business application benchmark.
- Apache Open For Business (OFBiz): An open-source suite of enterprise web applications. For these experiments, the data used by different instances of the same application was randomized to focus on code page sharing rather than data page sharing.
Key Insights and Ideas
- Inter-VM Sharing is Key: While hypervisors excel at intra-VM (self-sharing) and same-host inter-VM sharing, significant gains are missed by not considering sharing potential across hosts during placement.
- Fingerprints are Powerful Predictors: Memory fingerprints, especially Bloom filters, offer a surprisingly accurate and efficient way to predict page sharing potential without needing full memory dumps or complex analysis.
- Colocation Drives Capacity: By intelligently placing VMs with similar memory footprints together, data center capacity can be significantly increased, allowing more VMs to run on the same hardware.
- Dynamic Adaptation is Crucial: Memory sharing isn't static. Application behavior changes, necessitating dynamic adaptation (like hotspot mitigation) to maintain efficiency.
- Bloom Filters Offer a Practical Trade-off: For large-scale data centers, Bloom filters provide a compelling balance between accuracy, computational overhead, and communication bandwidth, making them a practical choice for fingerprinting.
Key Results
- Capacity Increase: Memory Buddies demonstrated an increase in data center capacity (measured by the number of supported VMs) of 17% compared to oblivious placement strategies.
- Sharing Potential: Analysis of real-world traces showed that approximately 37% of memory pages could be shared across a diverse set of machines if optimally colocated.
- Fingerprint Efficiency: Bloom filters, even at a fraction of the size of full hash lists (e.g., 5% of the size for 0.2% error rate), significantly reduce communication overhead and comparison time. For instance, Bloom filters can reduce sharing estimation time by an order of magnitude and network overhead by over 90% in large data centers.
- Hotspot Mitigation Effectiveness: The system successfully detected and resolved memory hotspots caused by workload changes by migrating VMs to consolidate sharing potential.
- Desktop Virtualization Planning: The tools can predict memory requirements for desktop virtualization scenarios, showing that colocating similar OS versions yields the highest sharing (up to 40%).
Limitations and Future Work
- Guest OS Fingerprinting: The current implementation fingerprints memory from within the guest OS. While this avoids hypervisor modifications, it means the system doesn't have perfect knowledge of which pages are truly sharable (e.g., due to hypervisor-level memory management like ballooning). The authors note this doesn't significantly impact the results as "ballooned" pages tend to have identical content (zeros) and thus identical hashes.
- Focus on Memory: The current system primarily focuses on memory sharing. While the authors mention that other resource hotspots (CPU, network) exist, they are not addressed by this work.
- Future Work: The authors plan to:
- Continue collecting memory traces for more extensive analysis.
- Enhance techniques to dynamically adjust VM memory allocation to further improve utilization and VM density.
- Integrate Memory Buddies more deeply with hypervisors and management infrastructure.
Summary updated