"Live Virtual Machine Migration with Adaptive Memory"
Live Virtual Machine Migration with Adaptive Memory Compression Hai Jin, Li Deng, Song Wu, Xuanhua Shi, Xiaodong Pan Services Computing Technology and System Lab Cluster and Grid Computing Lab School of Computer Science and Technology Huazhong University of Science and Technology Wuhan, 430074, CHINA Email: email@example.com Outline Introduction and Related Works Algorithm Design Implementation Performance Evaluation Conclusions and Future Work Introduction Live Migration of Virtual Machine A powerful management tool in clusters or data centers System maintenance Load balancing Fault tolerance Power management VM migration is expected to be fast and VM service degradation is expected to be low during migration Introduction Pre-copy A predominantly used approach in the state of the art Method First transfer all memory pages and then copy pages just modified during the last round iteratively Only memory and CPU status needs to be transferred VM service downtime is expected to be minimal by iterative copy operations Problem A great amount of transferred data Introduction CR/TR-Motion (checkpointing/recovery and trace/replay) Method Transfer execution trace file in iterations rather than dirty pages The total size of all log files is much less than that of dirty pages Total migration time and downtime of migration is drastically reduced Shortage It is valid only when the log replay rate is larger than the log growth rate The inequality between source and target nodes limits application scope of live VM migration in clusters Introduction Post-copy Method Memory transfer phase starts only after the VM’s CPU state has already been transferred to the target and resumed there All memory pages are transferred only once during the whole migration The baseline total migration time is achieved Shortage Downtime is prolonged due to the latency of fetching pages from the source node before VM can be resumed on the target Comparisons Typical Categories Characteristics systems Transfer memory VMware, Xen, memory data in pre-copy KVM, openVZ phase Pre-copy Transfer checkpoint and execution trace Live VM trace CR/TR-Motion files in pre-copy Migration phase Memory transfer is Michael R. deferred after CPU Post-copy status transfer Hines, VEE2009 phase VM is suspended Zap, Non-live VM during whole Collective, Migration migration process Denali, etc. Introduction In this paper, we propose MECOM A memory-compression-based VM migration system Features First exploit memory compression technique to improve the performance of live VM migration A zero-aware characteristics-based compression (CBC) algorithm is designed for live VM migration An adaptive memory compression approach to tune migration performance of VM Related Work Memory Compression General intention To bridge the huge performance gap between normal RAM and disk Characteristics Fast compression and extremely fast decompression Little memory overhead Categories Based on statistical models, such as Huffman coding Using a dictionary, such as Lempel-Ziv coding Hybrid methods, such as WK compression algorithm Algorithm Design Design Objective The compression algorithm should be lossless The compressed data need to be exactly reconstructed The overhead of memory compression should be small The relationship of overheads and compression effects is listed below Rcpr* ρcpr > Rtran Rcpr : the average memory compression rate ρcpr : the average compression ratio, the percentage of freed data Rtran : the average page transfer rate Algorithm Design Memory Data Characteristic Analysis Data compression algorithms are designed typically based on the regularities of data Memory page word-similarity ratio distribution of a 256MB-RAM virtual machine providing Apache service Algorithm Design Memory Page Characteristic Analysis Observation: 1) A majority of memory pages have more than 75% similarity or less than 25% similarity 2) Memory data contain a large proportion of zeros Algorithm Design Characteristic-Based Compression Algorithm for Live VM Migration Memory pages are classified into following kinds pages composed of a great many of zero bytes and sporadic nonzero bytes pages with high similarity pages with low similarity Different compression algorithms are used for pages with different kinds of regularities CBC Algorithm One memory page Y Compression Zero-page? algorithm1 N High word- Y Compression similarity? algorithm2 N Compression algorithm3 Push into compressed data Algorithm Design Benefits from CBC Algorithm Let φ = Rpage / Rtran Rpage : the average growth rate of dirty pages in the migrated VM Rtran : the average page transfer rate φ < 1, MECOM has faster convergence rate to reach the close point of pre-copy iterations than Xen φ >= 1, network transfer rate is augmented indirectly by factor 1/(1 - ρcpr) ρcpr : the average compression ratio, the percentage of freed data MECOM System Architecture MECOM is based on Xen 3.1.0. System Implementation Adaptive Compression Mode To tune migration performance of VMs in diverse application scenarios Automatically adjust the threshold of high word- similarity ratio Multi-threaded Compression To parallelize compression tasks to minimize overall compression time Exploit thread pool to reduce thread creation and destruction overheads Performance Evaluation Experimental Setup Hardware environment 2-way quad-core Intel® Xeon® E5405 @ 2GHz CPUs 8 GB DDR RAM Intel 80003ES2LAN gigabit network interface card Software The host kernel is the modified version of Xen 3.1.0 Redhat Enterprise Linux 5.0 as the guest OS and the privileged domain OS The guest OS is configured to use 4 VCPUs and 1GB of RAM Storage is accessed via iSCSI protocol from a NetApp F840 network attached storage server Performance Evaluation CPU Resource Reservation Test Goal: to evaluate the migration overhead of MECOM system. Effect of CPU reservation downtime of MECOM and Xen Little CPU resource is used during downtime phase Effect of CPU reservation on total migration time of Xen and MECOM about 30% CPU overhead less for compression Effect of memory writing rate on downtime of Xen and MECOM MECOM allows much higher dirty memory page rate than Xen Performance Evaluation Application Scenarios Static Web Server Apache 2.0.63 web server Dynamic Web Workload Tomcat 5-5.5.23 web server Kernel-compile (K-compile) Linux 2.6.18 kernel compilation MUMmer MUMmer 3.21, a scientific application to rapidly align genomes that has a very intensive memory usage dbench dbench 4.0, an open source benchmark producing the filesystem load Total transferred data of Xen and MECOM during live migration for diverse workloads Reduce at least 48.8%, at most 80.8%, an average of 68.8% Performance Evaluation The downtime of Xen and MECOM Total migration time of Xen and for diverse workloads MECOM for diverse workloads Reduce downtime and total migration time by an average of 27.1%, 32%, respectively Performance Evaluation Results of migrating a running web Results of migrating a running web server server VM using Xen and MECOM VM with adaptive rate limiting using Xen and MECOM Compared with Xen, MECOM not only significantly improves transmission rate, but also shortens total migration time Results of migrating a VM running a diabolical workload Conclusion and Future Work Conclusion MECOM First introduce memory compression technique into live VM migration Based on memory page characteristics, a particular memory compression algorithm is designed Experimental Results Compared with Xen, MECOM can significantly reduce 27.1% of downtime, 32% of total migration time, 68.8% of total transferred data Future Work Implement live wide-area migration of VMs including local persistent state with memory compression Thanks!