Applications of Virtual Machines For Scalable Reliable And
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 v. Matrix? Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 2
Virtual Machine Monitors Oracle, IIS My. SQL, Apache OS 1: Windows 2000 OS 2: Linux Virtual Machine 1: Virtual Machine 2: v. CPU, v. Mem, v. Disk, v. Net Virtual Machine Monitor (aka Hypervisor) Real Machine (CPU, Memory, Disks, Network) Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 3
Live Demo of VMware player: Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 4
The v. Matrix! 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 Ph. D Oral Exam 5
Contribution An overlay network of VMMs (the v. Matrix) enables backward-compatible improvement of the scalability, reliability, and interactivity of Internet services. Applications: 1. Dynamic Content Distribution 2. Server Switching 3. Fair placement of Game Servers Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 6
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 Ph. D Oral Exam 7
Today Is Static Mirroring Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 8
Dynamic Content Distribution Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 9
Two Tier Architecture Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 10
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 Ph. D Oral Exam 11
Challenges: Mobility (NAT) Internet 64. 58. 77. 28 NAT/LB 192. 168. 1. 10 VM 1 VM 2 VMM DNS VM Agent RM maps. yahoo. com 64. 58. 77. 28 Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 12
Challenges: Security (VPNs) 64. 58. 77. 28 Internet Intranet NAT/LB 172. 21. 162. 9 c 009. proxy. yahoo. com VPN 192. 168. 1. 10 VM 1 VM 2 VMM DNS VM Agent RM maps. yahoo. com 64. 58. 77. 28 Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 13
Two Tier Challenges • Response Time N 1 FRONT END N 2 BACK END FRONT END BACKEND • Perception! Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 14
Two Tier Challenges • Availability FRONT END Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam BACK END 15
The AJAX Solution Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 16
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 Ph. D Oral Exam 17
Second Application: Server Multiplexing Motivation: To allow statistical sharing of servers between services. Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 18
Static Servers (ala Circuit Switching) FINANCE SPORTS Load Balancer Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 19
Server Switching (ala Packet Switching) FINANCE & SPORTS v. Matrix Oracle Load Balancer Key: Peak of Sums < Sum of Peaks Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 20
What makes Switching hard ? • Software Dependencies • Hardware Dependencies • People Dependencies Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 21
v. Matrix Framework: The Oracle: This is the main control program Hibernation Nest: VM files are suspended and stored here for later retrieval. Loading Chambers: Development and Maintenance Cluster, there could be more than one VM per RM here. VM VMM RM VM VM RM VMM RM VM VM Production Cluster: Live operational VMs, typically one VM per RM VM VM RM VM VM VMM RM Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 22
Lifecycle of a server VM Hibernation Nest Loading Chambers Instantiated 1. A large number of virtual servers are stored as dormant files on a SAN or Netapps 2. A number of virtual servers are activated in a shared RM so that developers & system admins can upgrade, debug, or patch them. 3. A virtual server is activated on a dedicated RM and exposed to live load. Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 23
Sample Implementations: PHP-Nuke and os. Commerce Internet Services Yahoo! Autos Search Network API PHP (Hyper Text Processor) YSS (Yahoo Structured Search) Apache Web Server My. SQL Database YLIB (Yahoo C/C++ Libraries) Operating System: Red Hat Linux 9 Operating System: Yahoo Free. BSD 4. 8 Virtual Machine exposes a PIII-550 MHz with 512 MB RAM and 5. 5 GB hard disk. Virtual Machine exposes a PIII-550 MHz with 1024 MB RAM and 5. 5 GB hard disk. VMware ESX VMM Server (consumes 184 MB RAM, 3. 5 GB hard disk and 5% CPU) Real Machine (PIII-550 MHz, 640 MB RAM, 9 GB hard disk) Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 24
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 Ph. D Oral Exam 25
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 Ph. D Oral Exam 26
Delay Sensitivity of Online Games: Turn Based Strategy Not sensitive to lag (Civilization 4, Risk, Chess, Pool) (on the order of seconds) MMORPG and RTS Moderate sensitivity to lag (World of Warcraft, Everquest, Generals) (on the order of 500 ms) First Person Shooters (FPS) Extremely Lag sensitive (Halo, Battlefield 2, Doom, Counter. Strike) (on the order of 50 ms) Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 27
Screenshot from Halo PC: Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 28
The Problem: Unfair Lag 30 ms Game Server 130 ms Clan A Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam Clan B 29
The Solution: Equi-Ping Server Virtual Game Server in VM VMM 80 ms Real Machine 80 ms Clan A Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam Clan B 30
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 Ph. D Oral Exam 31
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 180 ms 2. For each server s, we compute a closeness factor Cs representing the average differential ping between the players if server s is picked: 3. Pick the server with smallest Cs The order of complexity of this algorithm is O(n 2 m) ≈ O(m) since m » n Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 32
Halo PC VM Server Stack Halo PC Game Server (278 MB) Operating System: Windows XP (1. 8 GB) Virtual Machine exposes a PIII-550 MHz with 512 MB RAM and 5. 5 GB hard disk. VMware ESX VMM Server (consumes 184 MB RAM, 3. 5 GB hard disk and 5% CPU) Real Machine (PIII-550 MHz, 640 MB RAM, 9 GB hard disk) Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 33
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 Ph. D Oral Exam 34
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 Ph. D Oral Exam 35
Related Work Common drawback: no backward compatibility. • Disk Imaging / Ghosting, (no concurrent VMs). • Application Servers: IBM Web. Sphere, ATG Dynamo, BEA Web. Logic, 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 Ph. D Oral Exam 36
Papers "The v. Matrix: A Network of Virtual Machine Monitors for Dynamic Content Distribution", Amr Awadallah and Mendel Rosenblum, 7 th International Workshop on Web Content Caching and Distribution (WCW 2002), Boulder, Colorado, August 2002 "The v. Matrix: Server Switching", Amr A. Awadallah and Mendel Rosenblum, IEEE 10 th International Workshop on Future Trends in Distributed Computing Systems (IEEE FTDCS 2004), Suzhou, China, May 2004. "The v. Matrix: Equi-Ping Game Server Placement For Pre-Arranged First-Person-Shooter Multiplayer Matches", Amr A. Awadallah and Mendel Rosenblum, The 4 th 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 Ph. D Oral Exam 37
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 Mc. Keown, IEEE INFOCOM 2000, Tel-Aviv, Israel, March 2000. Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 38
Conclusion The v. Matrix is an overlay network of virtual machine monitors enabling delivery of virtual machines between real machines. The v. Matrix is a practical backwardcompatible solution for improving the scalability, reliability, and interactivity of existing Internet applications. Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 39
Thank You Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 40
Appendix: VMware Perl API use VMware: : Control; use VMware: : Control: : Server; use VMware: : Control: : VM; # To register a new VM on a server $VMMserver->register($vmconfig); # To start and stop a VM my $VMMserver = VMware: : Control: : Server $VM->start(); : : new($hostname, $port, $user, $VM->stop(); $password); $VMMserver->connect(); my $VM = VMware: : Control: : VM : : new($server, $vmconfig); # To suspend and resume a VM $VM->suspend(); $VM->resume(); $VM->connect(); # To get CPU, Memory, Net, IO stats # To get a list of all VMs on a server $VM->get(“Status. Stats. vm. cpu. Usage”, 5*60); my @vmlist = $VMMserver->enumerate(); # Check if VM is running (heart-beat) $VM->get(“Status. Power”); Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 41
Two Tier Challenges • Replication FRONT END BACK END FRONT END Stanford University – CSL – 7/24/2006 – Amr A. Awadallah Ph. D Oral Exam 42
- Slides: 42