420 likes | 578 Views
Applications of Virtual Machines For Scalable, Reliable, And Interactive Internet Services. Ph.D. Oral Examination Amr A. Awadallah June 24 th , 2006 aaa@cs.stanford.edu http://www.awadallah.com/vmatrix. What is The vMatrix?. MySQL, Apache. OS2: Linux.
E N D
Applications of Virtual Machines For Scalable, Reliable, And Interactive Internet Services Ph.D. Oral ExaminationAmr A. AwadallahJune 24th, 2006aaa@cs.stanford.edu http://www.awadallah.com/vmatrix
What is The vMatrix? Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
MySQL, Apache OS2: Linux Virtual Machine 2:vCPU, vMem, vDisk, vNet Virtual Machine Monitors Oracle, IIS OS1: Windows 2000 Virtual Machine 1:vCPU, vMem, vDisk, vNet Virtual Machine Monitor (aka Hypervisor) Real Machine (CPU, Memory, Disks, Network) Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Live Demo of VMware player: Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
The vMatrix! A network for delivering virtual machines (VMs) between real machines (RMs) running the virtual machine monitor (VMM) software. Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Contribution An overlay network of VMMs (the vMatrix) enables backward-compatible improvement of the scalability, reliability, and interactivity of Internet services. Applications:1. Dynamic Content Distribution2. Server Switching3. Fair placement of Game Servers Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
First Application: Dynamic Content Distribution Motivation: To enable distribution of dynamic content. (40% of web requests) Definition:Dynamic content is web pages which are constructed by programs that execute on the server at the time a request is made. (e.g. http://maps.yahoo.com) Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Today Is Static Mirroring Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Dynamic Content Distribution Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Two Tier Architecture Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Main Problem It is very hard to copy services due to all the dependencies that code has on system libraries, third-party modules, operating systems, and server hardware. Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Internet 64.58.77.28 NAT/LB 192.168.1.10 VM1 VM2 DNS maps.yahoo.com 64.58.77.28 Challenges: Mobility (NAT) VMM RM VM Agent Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Internet 64.58.77.28 NAT/LB Challenges: Security (VPNs) VPN 192.168.1.10 VM1 VM2 Intranet 172.21.162.9 c009.proxy.yahoo.com VMM RM DNS VM Agent maps.yahoo.com 64.58.77.28 Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
N2 N1 BACK END BACK END FRONT END BACK END • Perception! FRONT END Two Tier Challenges • Response Time N1 Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
FRONT END BACK END Two Tier Challenges • Availability Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
The AJAX Solution Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Advantages • Faster Response Time • Higher Availability • Network Bandwidth Savings • Backward Compatibility Disadvantage • VM files are very large (order of gigabytes)! Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Second Application: Server Multiplexing Motivation: To allow statistical sharing of servers between services. Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Static Servers (ala Circuit Switching) FINANCE SPORTS Load Balancer Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Server Switching (ala Packet Switching) FINANCE & SPORTS vMatrix Oracle Load Balancer Key: Peak of Sums < Sum of Peaks Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
What makes Switching hard ? • Software Dependencies • Hardware Dependencies • People Dependencies Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
VM VM VM VM VM VM VM VM VM VMM VMM VMM VMM VMM RM RM RM RM RM VM VM VM VM VM VM VM VM vMatrix Framework: Production Cluster: Live operational VMs, typically only one VM per RM Loading Chambers: Development and Maintenance Cluster, there could be more than one VM per RM here. The Oracle: This is the main control program Hibernation Nest: VM files are suspended and stored here for later retrieval. Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Lifecycle of a server VM 1. A large number of virtual servers are stored as dormant files on a SAN or Netapps Hibernation Nest 2. A number of virtual servers are activated in a shared RM so that developers & system admins can upgrade, debug, or patch them. Loading Chambers 3. A virtual server is activated on a dedicated RM and exposed to live load. Instantiated Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
PHP-Nuke and osCommerce Internet Services PHP (Hyper Text Processor) Apache Web Server MySQL Database Operating System: Red Hat Linux 9 Virtual Machine exposes a PIII-550MHz with 512MB RAM and 5.5GB hard disk. VMware ESX VMM Server (consumes 184MB RAM, 3.5GB hard disk and 5% CPU) Real Machine (PIII-550MHz, 640MB RAM, 9GB hard disk) Yahoo! Autos Search Network API YSS (Yahoo Structured Search) YLIB (Yahoo C/C++ Libraries) Operating System: Yahoo FreeBSD 4.8 Virtual Machine exposes a PIII-550MHz with 1024MB RAM and 5.5GB hard disk. VMware ESX VMM Server (consumes 184MB RAM, 3.5GB hard disk and 5% CPU) Real Machine (PIII-550MHz, 640MB RAM, 9GB hard disk) Sample Implementations: Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Advantages • Presents developers with isolation model they expect • Backward Compatibility • Efficient Resource Utilization (People and Power) • Peak Absorption • Faster Recovery Disadvantages • VM files are very large (order of gigabytes)! • VM Software is not free • Operating System Licensing Issues Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Third Application: Equi-Ping Game Server Placement For Pre-Arranged First-Person-Shooter Multiplayer Matches Motivation: To place game server hosts optimally such that all participating players have a fairer game experience. Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Delay Sensitivity of Online Games: Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Screenshot from Halo PC: Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
The Problem: Unfair Lag 30ms Game Server 130ms Clan A Clan B Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
The Solution: Equi-Ping Server Virtual Game Server in VM VMM Real Machine 80ms 80ms Clan A Clan B Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Equi-ping placement problem • Red dots are servers, green dots are players, we need to pick the Red dot that is equi-distant from all players. Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Equi-ping placement Algorithm S = set of m servers available to host the match. P = set of n players participating in this match. RTTs,p = round-trip-time (ping) from server s to player p The Algorithm has 3 main steps: 1. Disregard all servers that have any RTTs,p larger than 180ms • For each server s, we compute a closeness factor Cs representing the average differential ping between the players if server s is picked: • Pick the server with smallest Cs The order of complexity of this algorithm is O(n2m) ≈ O(m) since m»n Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Halo PC Game Server (278MB) Operating System: Windows XP (1.8GB) Virtual Machine exposes a PIII-550MHz with 512MB RAM and 5.5GB hard disk. VMware ESX VMM Server (consumes 184MB RAM, 3.5GB hard disk and 5% CPU) Real Machine (PIII-550MHz, 640MB RAM, 9GB hard disk) Halo PC VM Server Stack Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Advantages: • Equi-ping placement of game servers to minimize round-trip-time difference between participants • Backward compatibility leading to zero cost for converting existing • Economies of scale: this network can be shared among many games Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Applications Summary • Dynamic Content Distribution which improves interactivity for Internet services. • Server Switching which improves resource utilization, availability and enables peek absorption. • Equi-ping server placement for game host servers which is very important for the fairness of online FPS games. Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Related Work Common drawback: no backward compatibility. • Disk Imaging / Ghosting, (no concurrent VMs). • Application Servers: IBM WebSphere, ATG Dynamo, BEA WebLogic, JBoss, (no strict isolation, interface violations). • Java Virtual Machine (J#/C#/.Net), (needs recoding, low performance). • Packagers: Debian APT, Redhat RPM, PRC, (no isolation). • Light Weight OSes (Denali), (new OS API, needs recoding). • OS Virtualization (Ensim, Ejasent, EXETender, Chrooting), (tied to OS). • Active Proxy Caches (ICAP, Active cache, OPES) Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Papers "The vMatrix: A Network of Virtual Machine Monitors for Dynamic Content Distribution", Amr Awadallah and Mendel Rosenblum, 7th International Workshop on Web Content Caching and Distribution (WCW 2002), Boulder, Colorado, August 2002 "The vMatrix: Server Switching", Amr A. Awadallah and Mendel Rosenblum, IEEE 10th International Workshop on Future Trends in Distributed Computing Systems (IEEE FTDCS 2004), Suzhou, China, May 2004. "The vMatrix: Equi-Ping Game Server Placement For Pre-Arranged First-Person-Shooter Multiplayer Matches", Amr A. Awadallah and Mendel Rosenblum, The 4th ACS/IEEE International Conference on Computer Systems and Applications (AICCSA 2006), Dubai/Sharjah, UAE, March 2006 Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Other Papers "TCP-BFA: Buffer Fill Avoidance", Amr A. Awadallah and Chetan Rai, IFIP High Performance Networking Conference, Vienna, Austria, September 1998. "Analysis of a packet switch with memories running slower than the line-rate", Sundar Iyer, Amr A. Awadallah, and Nick McKeown, IEEE INFOCOM 2000, Tel-Aviv, Israel, March 2000. Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Conclusion The vMatrix is an overlay network of virtual machine monitors enabling delivery of virtual machines between real machines. The vMatrix is a practical backward-compatible solution for improving the scalability, reliability, and interactivity of existing Internet applications. Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Thank You Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
Appendix: VMware Perl API # To register a new VM on a server $VMMserver->register($vmconfig); # To start and stop a VM $VM->start(); $VM->stop(); # To suspend and resume a VM $VM->suspend(); $VM->resume(); # To get CPU, Memory, Net, IO stats $VM->get(“Status.Stats.vm.cpuUsage”, 5*60); # Check if VM is running (heart-beat) $VM->get(“Status.Power”); use VMware::Control; use VMware::Control::Server; use VMware::Control::VM; my $VMMserver = VMware::Control::Server ::new($hostname, $port, $user, $password); $VMMserver->connect(); my $VM = VMware::Control::VM ::new($server, $vmconfig); $VM->connect(); # To get a list of all VMs on a server my @vmlist = $VMMserver->enumerate(); Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam
FRONT END FRONT END FRONT END BACK END Two Tier Challenges • Replication Stanford University – CSL – 7/24/2006 – Amr A. Awadallah PhD Oral Exam