main points
play

Main Points How virtual machines work Why network and disk - PowerPoint PPT Presentation

Main Points How virtual machines work Why network and disk I/O is slow What we can do about it Server 4. 9. Request Reply Parse Request Format Reply


  1. Main ¡Points • How ¡virtual ¡machines ¡work ¡ • Why ¡network ¡and ¡disk ¡I/O ¡is ¡slow ¡ ¡ • What ¡we ¡can ¡do ¡about ¡it ¡

  2. Server 4. 9. Request Reply Parse Request Format Reply Buffer Buffer 1. 3. 5. 8. 10. Network Kernel Copy File Read Kernel Copy Write and Copy Socket Read to Kernel Buffer Kernel 2. 6. 7. 12. Copy Arriving Disk Request Disk Data Format Outgoing Packet (DMA) (DMA) Packet and DMA Hardware Network Interface Disk Interface

  3. Virtual ¡Machines • Most ¡data ¡centers ¡insert ¡an ¡extra ¡“virtual ¡machine” ¡ layer ¡ • Modify ¡host ¡opera@ng ¡system ¡so ¡that ¡it ¡can ¡run ¡a ¡ “guest” ¡opera@ng ¡system ¡as ¡a ¡(user-­‑level) ¡applica@on ¡ • Guest ¡opera@ng ¡system ¡thinks ¡it ¡is ¡running ¡on ¡raw ¡ hardware ¡ • Runs ¡at ¡user-­‑level ¡ • Applica@on ¡(guest ¡user-­‑level) ¡thinks ¡it ¡is ¡running ¡on ¡ guest ¡OS ¡running ¡on ¡raw ¡hardware ¡ • Has ¡guest ¡OS ¡to ¡itself ¡

  4. Virtual ¡Machine ¡Pros/Cons • Separa@on ¡of ¡data ¡center ¡management ¡from ¡ applica@on’s ¡choice ¡of ¡opera@ng ¡system ¡ • Mul@ple ¡web ¡servers ¡per ¡physical ¡machine ¡ • Each ¡with ¡a ¡different ¡OS ¡ ¡ • Easy ¡to ¡migrate ¡virtual ¡machine ¡ • Easy ¡to ¡limit ¡access ¡by ¡guest ¡OS ¡to ¡other ¡nodes ¡ • Cost ¡of ¡redirec@on ¡ • For ¡virtual ¡memory ¡mapping ¡and ¡I/O ¡ • Emerging ¡hardware ¡support ¡to ¡reduce ¡cost ¡

  5. Guest User Mode Guest Guest Host User Mode Process Process ... Guest trap Program ... Counter Host User Mode Guest Kernel Mode Guest Kernel Timer Guest PC Guest Guest Handler Guest SP Exception Guest file system Interrupt Syscall Guest Flags Stack and other kernel Table Handler services Host KernelMode Host Kernel Timer Host PC Host Host Handler Host SP Exception Virtual Interrupt Syscall Host Flags Stack Table Disk Handler Hardware Physical Disk

  6. Ques5on • How ¡many ¡crossings ¡are ¡needed ¡to ¡handle ¡a ¡web ¡ request ¡on ¡a ¡server ¡running ¡on ¡a ¡guest ¡OS ¡running ¡ on ¡a ¡virtual ¡machine? ¡ • Network ¡I/O ¡interrupt ¡delivered ¡to ¡host ¡kernel ¡ • Transfers ¡control ¡to ¡guest ¡OS ¡to ¡handle ¡interrupt ¡ • Return ¡from ¡interrupt ¡back ¡to ¡host ¡kernel ¡ • Resumes ¡applica@on ¡ • System ¡call ¡trap ¡to ¡read ¡from ¡network, ¡to ¡host ¡kernel ¡ • Transfers ¡control ¡to ¡guest ¡OS ¡to ¡handle ¡system ¡call ¡ • Return ¡from ¡system ¡call ¡back ¡to ¡host ¡kernel ¡ • Resumes ¡applica@on ¡

  7. Virtual ¡Machines ¡and ¡Virtual ¡Memory Guest Physical Guest Virtual Host Physical Address Space Address Space Memory Guest Page Table Host Page Table Guest Virtual Guest Physical Address Address Guest Physical Address Host Physical Address

  8. Shadow ¡Page ¡Tables Guest Virtual Guest Physical Host Physical Address Space Address Space Memory Guest Page Table Host Page Table Guest Virtual Guest Physical Address Address Guest Physical Address Host Physical Address Shadow Page Table Host Physical Address

  9. Hardware ¡Support ¡for ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ Virtual ¡Machine ¡Transla5on • x86 ¡recently ¡added ¡hardware ¡support ¡for ¡running ¡ virtual ¡machines ¡at ¡user ¡level ¡ • Opera@ng ¡system ¡kernel ¡ini@alizes ¡two ¡sets ¡of ¡ transla@on ¡tables ¡ • One ¡for ¡the ¡guest ¡OS ¡ • One ¡for ¡the ¡host ¡OS ¡ • Hardware ¡translates ¡address ¡in ¡two ¡steps ¡ • First ¡using ¡guest ¡OS ¡tables, ¡then ¡host ¡OS ¡tables ¡ • TLB ¡holds ¡composi@on ¡

  10. Containers • Provide ¡applica@ons ¡the ¡illusion ¡of ¡their ¡own ¡virtual ¡ machine ¡ • Own ¡process ¡ID ¡table ¡ • Own ¡network ¡socket ¡addresses ¡ • Own ¡file ¡descriptor ¡table ¡ • Running ¡directly ¡on ¡Linux ¡or ¡other ¡OS ¡ • By ¡modifying ¡system ¡call ¡handling ¡ • No ¡system ¡call ¡redirec@on ¡ • No ¡virtual ¡machine ¡redirec@on ¡

  11. Ar Arrakis: ¡High ¡I/O ¡Performance ¡OS • Server ¡I/O ¡performance ¡ma[ers ¡ • Key-­‑value ¡stores, ¡web ¡& ¡file ¡servers, ¡lock ¡managers, ¡… ¡ • Can ¡OSes ¡deliver ¡hardware ¡performance? ¡ Today’s ¡I/O ¡devices ¡are ¡fast ¡ • Example ¡system: ¡Dell ¡PowerEdge ¡R520 ¡ + ¡ + ¡ = ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ $1,200 ¡ Intel ¡X520 ¡ Intel ¡RS3 ¡RAID ¡ Sandy ¡Bridge ¡CPU ¡ 10G ¡NIC ¡ 1GB ¡flash-­‑backed ¡cache ¡ 6 ¡cores, ¡2.2 ¡GHz ¡ 50ns ¡/ ¡64B ¡pkt ¡ 25 ¡us ¡/ ¡1KB ¡write ¡

  12. Networks: ¡Fast ¡and ¡Growing ¡Faster 1 ¡T ¡ 400 ¡GbE ¡ Ethernet ¡Bandwidth ¡[bits/s] ¡ 100 ¡GbE ¡ 100 ¡G ¡ 40 ¡GbE ¡ 12ns ¡inter-­‑arrival ¡@me ¡for ¡ 10 ¡GbE ¡ 64B ¡packets ¡at ¡40Gbps ¡ 10 ¡G ¡ 1 ¡GbE ¡ 1 ¡G ¡ 100 ¡MbE ¡ 100 ¡M ¡ 1990 ¡ 1995 ¡ 2000 ¡ 2005 ¡ 2010 ¡ 2015 ¡ 2020 ¡ Year ¡of ¡Standard ¡Release ¡

  13. Can’t ¡we ¡just ¡use ¡Linux?

  14. Linux ¡ ¡I/O ¡Performance % ¡OF ¡1KB ¡REQUEST ¡TIME ¡SPENT ¡ HW ¡18% ¡ App ¡20% ¡ 9 ¡us ¡ Kernel ¡62% ¡ GET ¡ Redis ¡ App ¡ HW ¡ 163 ¡us ¡ Kernel ¡84% ¡ SET ¡ 13% ¡ 3% ¡ Kernel ¡media^on ¡ API ¡ Mul@plexing ¡ is ¡too ¡heavyweight ¡ Naming ¡ Resource ¡limits ¡ Kernel ¡ Access ¡control ¡ I/O ¡Scheduling ¡ Data ¡ I/O ¡Processing ¡ Copying ¡ Path ¡ Protec@on ¡ RAID ¡Storage ¡ 10G ¡NIC ¡ 25 ¡us ¡/ ¡1KB ¡write ¡ 50ns ¡/ ¡64B ¡packet ¡

  15. Arrakis ¡Goals Ar • Skip ¡ kernel ¡ & ¡deliver ¡I/O ¡ directly ¡ to ¡applica@ons ¡ • Reduce ¡OS ¡overhead ¡ ¡ • Keep ¡ classical ¡server ¡OS ¡kernel ¡features ¡ • Process ¡protec@on ¡ • Resource ¡limits ¡ • I/O ¡protocol ¡flexibility ¡ • Global ¡naming ¡ • The ¡hardware ¡can ¡help ¡us… ¡

  16. Hardware ¡I/O ¡Virtualiza5on • Standard ¡on ¡network, ¡emerging ¡on ¡storage ¡ ¡ Redis ¡ Webserver ¡ Provided ¡in ¡hardware: ¡ • Mul@plexing ¡ VNIC 1 VNIC 2 • E.g., ¡Virtual ¡network ¡cards ¡(VNICs) ¡ Rate ¡limiters ¡ • Protec@on ¡ NIC ¡packet ¡filters ¡ • A[ach ¡VNICs ¡to ¡applica@on ¡memory ¡ • Packet ¡filters , ¡ logical ¡disks : ¡ Allow ¡only ¡eligible ¡I/O ¡from ¡apps ¡ • I/O ¡Scheduling ¡ Network ¡ • Rate ¡limiters , ¡ packet ¡schedulers ¡

  17. How ¡to ¡skip ¡the ¡kernel? Redis ¡ Redis ¡ Library ¡ API ¡ Mul@plexing ¡ Naming ¡ Resource ¡limits ¡ Kernel ¡ Access ¡control ¡ I/O ¡Scheduling ¡ Data ¡ I/O ¡Processing ¡ Copying ¡ Path ¡ Protec@on ¡ I/O ¡Devices ¡

  18. Arrakis ¡I/O ¡Architecture Ar Control ¡Plane ¡ Data ¡Plane ¡ Redis ¡ Redis ¡ API ¡ I/O ¡Processing ¡ Kernel ¡ Kernel ¡ Naming ¡ Naming ¡ Data ¡Path ¡ Access ¡control ¡ Access ¡control ¡ Resource ¡limits ¡ Resource ¡limits ¡ I/O ¡Devices ¡ Protec@on ¡ Mul@plexing ¡ I/O ¡Scheduling ¡

  19. Ar Arrakis ¡ ¡Control ¡Plane • Access ¡control ¡ • Do ¡ once ¡when ¡configuring ¡data ¡plane ¡ • Enforced ¡via ¡NIC ¡filters, ¡logical ¡disks ¡ • Resource ¡limits ¡ • Program ¡hardware ¡I/O ¡schedulers ¡ • Global ¡naming ¡ • Virtual ¡file ¡system ¡s@ll ¡ in ¡kernel ¡ • Storage ¡implementa^on ¡in ¡applica^ons ¡

  20. Storage ¡Space ¡Alloca5on HW ¡ Redis ¡ Virtual ¡Storage ¡Area ¡ ops ¡ Disk ¡space ¡ create_storage(1G) Free ¡space ¡ Free ¡space ¡ Used ¡ Free ¡space ¡ Kernel ¡

  21. Global ¡Naming Virtual ¡Storage ¡Area ¡ Fast ¡ Redis ¡ ¡ HW ¡ops ¡ /tmp/lockfile /var/lib/key_value.db Indirec^on ¡ /etc/config.rc … emacs ¡ open(“/etc/config.rc”) ¡ Logical ¡ Kernel ¡ disk ¡ VFS ¡

  22. Arrakis ¡I/O ¡Architecture Ar Control ¡Plane ¡ Data ¡Plane ¡ Redis ¡ Redis ¡ Redis ¡ API ¡ API ¡ I/O ¡Processing ¡ I/O ¡Processing ¡ Kernel ¡ Naming ¡ Data ¡Path ¡ Access ¡control ¡ Resource ¡limits ¡ I/O ¡Devices ¡ Protec@on ¡ Mul@plexing ¡ I/O ¡Scheduling ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend