alibaba dragonwell jdk
play

Alibaba Dragonwell JDK: Towards a Java Runtime for Cloud Computing - PowerPoint PPT Presentation

Alibaba Dragonwell JDK: Towards a Java Runtime for Cloud Computing Xiaoming Gu Alibaba JVM Team 1 System Software (OS / JVM / Virtualization) Resource Scheduling / Cluster Management / Container Database / Storage / Middleware / Computing


  1. Alibaba Dragonwell JDK: Towards a Java Runtime for Cloud Computing Xiaoming Gu Alibaba JVM Team 1

  2. System Software (OS / JVM / Virtualization) Resource Scheduling / Cluster Management / Container Database / Storage / Middleware / Computing Platform Alibaba Infrastructure ... 2019 2019 2

  3. Singles’ Day Shopping Festival Peak #transactions per second 350000 325,000 300000 250000 more than 100x 256,000 in 7 years 200000 175,000 2019 2019 140,000 150000 100000 120,000 80,000 86,000 42,000 50000 14,000 38,000 3200 15,000 3,850 0 1200 2011 2012 2013 2014 2015 2016 2017 Alibaba cloud platform Alibaba payment service 3

  4. • A customized downstream of OpenJDK with free LTS • https://github.com/alibaba/dragonwell8 2019 2019 • Preview now and GA soon • Will be the recommended JDK on Alibaba Cloud • Plan to update in every 3 months 4

  5. Key Customizations in Alibaba Dragonwell JDK • Java Flight Recorder (JFR) • Low-overhead profiling framework • Backported JFR from OpenJDK 11 to Alibaba Dragonwell 8 2019 2019 • In progress pushing back to OpenJDK 8 • JWarmUp • Reduce startup time by reusing Just-in-Time (JIT) compilation info from a previous run • In progress pushing back to OpenJDK 5

  6. AppAOT • A challenge in the cloud 2019 2019 • CPU utilization is high during JVM startup • Caused by excessive JIT compilations 6

  7. AppAOT • Ahead-of-Time (AOT) compilation • AOT in OpenJDK • jaotc --output libHelloWorld.so HelloWorld.class 2019 2019 • java -XX:AOTLibrary=./libHelloWorld.so HelloWorld • CPU utilization by JIT compilations saved • Limitation: AOT code loaded when JVM starts 7

  8. AppAOT • Enhanced from AOT: dynamically load/unload AOT code with the support of custom class loaders • Java API 2019 2019 • AppAOTController.loadAOTLibraryForLoader(ClassLoader loader, String library) • AppAOTController.unloadAOTLibraryForLoader(ClassLoader loader) 8

  9. AppAOT • Reduce AOT code size app entry y method • Use static analysis to construct call graph fo foo::m ::m1 foo::m fo ::m2 • Generate compilation method list from call graph with unreachable methods removed Call graph 2019 2019 cal call bar: bar::m1 m1 • Do AOT compilations for methods on the compilation method list only • Results from an example app • 50% reduction on code size Method list • 90% of actually executed methods covered 9

  10. AppAOT • Use case Normal case (with JIT) App App App App App App App App 2019 2019 1 2 2 N N 3 3 …… (.jar) (. ar) (. (.jar) ar) (.jar) (. ar) (. (.jar) ar) Co Commo mmon App Pla latform rm 10

  11. AppAOT • Use case With AppAOT AOT’ AOT’ed ed AOT’ AOT’ed ed AOT’ed AOT’ ed AOT’ed AOT’ ed 2019 2019 App 1 Ap 1 Ap App 2 2 App 3 Ap 3 App N Ap N …… (.so so) (.so so) (.so so) (.so so) Commo Co mmon App Pla latform rm 11

  12. AppAOT • Results 120 12 AppAO AppAOT use ses s less ss CPU CPU utilization CPU utilization at app st startup time 10 100 80 80 2019 2019 60 60 40 40 Peak k performance of AppAOT is AppAO s si similar to JI JIT 20 20 —— —— JI JIT —— —— Ap AppAO AOT 0 1 5 9 13 13 17 17 21 21 25 25 29 29 33 33 37 37 41 41 45 45 49 49 53 53 57 57 61 61 65 65 69 69 73 73 77 77 81 81 85 85 89 89 93 93 97 97 101 101 105 105 109 109 113 113 117 117 121 121 125 125 129 129 133 133 137 137 141 141 145 145 149 149 153 153 157 157 161 161 165 165 169 169 173 173 177 177 181 181 185 185 189 189 193 193 197 197 201 201 205 205 209 209 213 213 217 217 221 221 225 225 229 229 233 233 aot_tiered jit 12

  13. Elastic Heap • Multiple Java applications running on the same host together • Memory is a shared resource 2019 2019 • Memory consumption changes along running • Dynamically resize heap on demand 13

  14. Elastic Heap • Garbage collection (GC) • Automatic memory management on heap • Reclaim the space occupied by dead objects 2019 2019 • Intuition • Increase heap size when GC happens more • Decrease heap size with GC happens less 14

  15. Elastic Heap • Use case before midnght shortly after before traffic peak traffic peak 2019 2019 online service with higher memory pressure onl online ne of offline ne of offline ne onl online ne servi se vice servi se vice se servi vice servi se vice offline service with lower memory pressure 15

  16. Elastic Heap shortly after before midnght after traffic peak traffic peak for a while 2019 2019 online service with lower memory pressure onl online ne of offline ne offline of ne onl online ne servi se vice se servi vice se servi vice se servi vice offline service with higher memory pressure 16

  17. Elastic Heap • Results from an online service CPU utilization traffic peak traffic peak starts ends 2019 2019 Memory usage return memory acquire memory back to OS from OS time 17

  18. Elastic Heap • Both OpenJDK and our solution are based on Garbage-First (G1) GC • The solution in OpenJDK is for full GC and concurrent cycle only 2019 2019 • Young GC is covered in our solution • Heap resizing is more prompt because Young GC happens more frequently • Heap resizing is concurrent 18

  19. Summary • Challenges in the cloud • Excessive CPU utilization caused by JIT compilations 2019 2019 • AppAOT • Better memory sharing across JVM instances on the same host • Elastic heap 19

  20. Q & A 20

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