use of java / jvm at twitter · #twitter : services • a #huge distributed system • huge number...

15
Use of Java / JVM at Twitter @TonyPrintezis | @TwitterBoston [email protected]

Upload: others

Post on 11-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Use of Java / JVM at Twitter · #Twitter : services • A #huge distributed system • huge number of machines running a huge number of JVMs • multiple data centers • services

Use of Java / JVM at Twitter

@TonyPrintezis | @TwitterBoston

[email protected]

Page 2: Use of Java / JVM at Twitter · #Twitter : services • A #huge distributed system • huge number of machines running a huge number of JVMs • multiple data centers • services

@TonyPrintezis | JCP EC Meeting | Oct 2015

#JCP EC Twitter reps

Tony Printezis • VM Team | Infrastructure Org | Twitter • ex-HotSpot (Sun / Oracle, 6+ years), ex-SunLabs (3+ years)

Ramki Ramakrishna • VM Team | Infrastructure Org | Twitter • ex-HotSpot (Sun / Oracle, 10+ years)

2

Page 3: Use of Java / JVM at Twitter · #Twitter : services • A #huge distributed system • huge number of machines running a huge number of JVMs • multiple data centers • services

@TonyPrintezis | JCP EC Meeting | Oct 2015

#Twitter

3

Page 4: Use of Java / JVM at Twitter · #Twitter : services • A #huge distributed system • huge number of machines running a huge number of JVMs • multiple data centers • services

@TonyPrintezis | JCP EC Meeting | Oct 2015

#Twitter : the short version

#Platform #RealTime

4

Page 5: Use of Java / JVM at Twitter · #Twitter : services • A #huge distributed system • huge number of machines running a huge number of JVMs • multiple data centers • services

@TonyPrintezis | JCP EC Meeting | Oct 2015

#Twitter : services• A #huge distributed system

• huge number of machines running a huge number of JVMs • multiple data centers • services communicate with other services via RPC • typically, many JVMs per service

• Most services run on • CentOS Linux distribution (x64) • OpenJDK distribution (TwitterJDK) • Mesos (data center scheduling) • Finagle (async RPC for Scala / Java)

5

Page 6: Use of Java / JVM at Twitter · #Twitter : services • A #huge distributed system • huge number of machines running a huge number of JVMs • multiple data centers • services

@TonyPrintezis | JCP EC Meeting | Oct 2015

#Twitter : programming languagesserver-side • Scala (most used by far) • Java • Ruby (moving away from it…) • C/C++ (a bit) • Python (a bit)

6

Page 7: Use of Java / JVM at Twitter · #Twitter : services • A #huge distributed system • huge number of machines running a huge number of JVMs • multiple data centers • services

@TonyPrintezis | JCP EC Meeting | Oct 2015

#Twitter : Java libraries• We rely heavily on

• NIO • collections • concurrent collections • concurrent utilities • etc.

7

Page 8: Use of Java / JVM at Twitter · #Twitter : services • A #huge distributed system • huge number of machines running a huge number of JVMs • multiple data centers • services

@TonyPrintezis | JCP EC Meeting | Oct 2015

#TwitterJDK

8

Page 9: Use of Java / JVM at Twitter · #Twitter : services • A #huge distributed system • huge number of machines running a huge number of JVMs • multiple data centers • services

@TonyPrintezis | JCP EC Meeting | Oct 2015

#TwitterJDK : vm team• Infrastructure Org • Responsible for releasing, maintaining, customizing, improving

• TwitterJDK • Developer support

• consultancy • troubleshooting • education

9

Page 10: Use of Java / JVM at Twitter · #Twitter : services • A #huge distributed system • huge number of machines running a huge number of JVMs • multiple data centers • services

@TonyPrintezis | JCP EC Meeting | Oct 2015

#TwitterJDK : why?Why deploy our own JDK? • Commercial support wouldn't work for us

• too expensive • too slow

• OpenJDK development is slow • dreadfully slow process • change turnaround feels like eternity

• current development repo is JDK 9, months / years away • backports to JDK 8: slow turnaround

• We believe we can support ourselves best

10

Page 11: Use of Java / JVM at Twitter · #Twitter : services • A #huge distributed system • huge number of machines running a huge number of JVMs • multiple data centers • services

@TonyPrintezis | JCP EC Meeting | Oct 2015

#TwitterJDK : pushing the limits• We push the JVM's limits more than most

• large heaps • huge scale • strict latency requirements

• Optimize for our stack • Scala, Finagle, CentOS, x64, etc.

• Optimize for our workloads • quite different vs. most other JVM workloads I’m familiar with

11

Page 12: Use of Java / JVM at Twitter · #Twitter : services • A #huge distributed system • huge number of machines running a huge number of JVMs • multiple data centers • services

@TonyPrintezis | JCP EC Meeting | Oct 2015

#TwitterJDK : release

12

TwitterJDK Build

hg-git

hg.openjdk.java.net

OpenJDK Repos

corba hotspot jdk …

Twitter

Twitter Repos

corba hotspot (+changes) jdk (+changes) …

git

Page 13: Use of Java / JVM at Twitter · #Twitter : services • A #huge distributed system • huge number of machines running a huge number of JVMs • multiple data centers • services

@TonyPrintezis | JCP EC Meeting | Oct 2015

#TwitterJDK : release• Based on OpenJDK

• Synced up to the latest update release • leverage all OpenJDK testing

• Plus our own changes • which we'll be happy to contribute back BTW…

• Plus (small number of) additional patches (e.g., security / critical fixes) • Monthly releases • Current main release

• JDK 8 / Tiered Compilation / 64-bit / CentOS

13

Page 14: Use of Java / JVM at Twitter · #Twitter : services • A #huge distributed system • huge number of machines running a huge number of JVMs • multiple data centers • services

@TonyPrintezis | JCP EC Meeting | Oct 2015

#TwitterJDK : enhancements• Heap Profiling • Binary Logging Framework (JVM + Java tracepoints) • Intermediate Generation(s) for G1 GC • Misc Bug / Performance Fixes • Mostly in HotSpot + a few small patches to the JDK libraries

14

Page 15: Use of Java / JVM at Twitter · #Twitter : services • A #huge distributed system • huge number of machines running a huge number of JVMs • multiple data centers • services

@TonyPrintezis | JCP EC Meeting | Oct 2015

#Questions

15