my talk at linux piter 2016

51
On performance analyzing again: Gathering and visualizing flamegraphs in realtime in Linux environment Alex Chistyakov, DataArt Linux Piter 2016, Russia, SPb. Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 1 / 51

Upload: alex-chistyakov

Post on 16-Apr-2017

1.441 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: My talk at Linux Piter 2016

On performance analyzing again:Gathering and visualizing flamegraphs in

realtime in Linux environment

Alex Chistyakov, DataArt

Linux Piter 2016, Russia, SPb.

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 1 / 51

Page 2: My talk at Linux Piter 2016

Who I am (very quickly)

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 2 / 51

• Senior SW Developer @ DataArt

• More than 18 years of professional experience

• Researcher @ ISST Lab, ITMO

• Used to be a DevOps Engineer and still probably am

• Can’t quit making presentations w/lots of bullets (that’sterrible, I know)

Page 3: My talk at Linux Piter 2016

Performance optimization is not that hard

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 3 / 51

Page 4: My talk at Linux Piter 2016

Ever heard of a ’comfort zone’?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 4 / 51

• It’s crucial to be out of it to learn something new

Page 5: My talk at Linux Piter 2016

Ever heard of a ’comfort zone’?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 5 / 51

• It’s crucial to be out of it to learn something new

• So I made this presentation in TeX

Page 6: My talk at Linux Piter 2016

Ever heard of a ’comfort zone’?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 6 / 51

• It’s crucial to be out of it to learn something new

• So I made this presentation in TeX

• With lots of bullets, you know

Page 7: My talk at Linux Piter 2016

Ever heard of a ’comfort zone’?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 7 / 51

• It’s crucial to be out of it to learn something new

• So I made this presentation in TeX

• With lots of bullets, you know

• Because I’m not ready yet to leave my comfort zoneentirely

Page 8: My talk at Linux Piter 2016

Ever heard of a ’comfort zone’?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 8 / 51

• It’s crucial to be out of it to learn something new

• So I made this presentation in TeX

• With lots of bullets, you know

• Because I’m not ready yet to leave my comfort zoneentirely

• Damn, TeX seems to be my new comfort zone ;(

Page 9: My talk at Linux Piter 2016

Okay, flashback to LP 2015 (w/no bullets)

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 9 / 51

Page 10: My talk at Linux Piter 2016

Fast-forward to 2016

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 10 / 51

Brendan Gregg declared Linux DTrace-complete!

Page 11: My talk at Linux Piter 2016

A great step forward for mankind...

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 11 / 51

...but I’m a cat

Page 12: My talk at Linux Piter 2016

So, what is this all about?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 12 / 51

• Modern GNU/Linux

Page 13: My talk at Linux Piter 2016

So, what is this all about?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 13 / 51

• Modern GNU/Linux

• A web application

Page 14: My talk at Linux Piter 2016

So, what is this all about?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 14 / 51

• Modern GNU/Linux

• A web application

• Collecting flamegraphs

Page 15: My talk at Linux Piter 2016

So, what is this all about?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 15 / 51

• Modern GNU/Linux

• A web application

• Collecting flamegraphs

• Visualizing collected flamegraphs

Page 16: My talk at Linux Piter 2016

Okay, but what are these flame... things?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 16 / 51

Did you attend LP 2015?

Page 17: My talk at Linux Piter 2016

Doing flamegraphs in 2016 is extremely easy

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 17 / 51

Page 18: My talk at Linux Piter 2016

A hicker needs good boots

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 18 / 51

Page 19: My talk at Linux Piter 2016

So, we need a language

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 19 / 51

Page 20: My talk at Linux Piter 2016

The obvious choice

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 20 / 51

Page 21: My talk at Linux Piter 2016

Why Lisp?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 21 / 51

• Homoiconicity

Page 22: My talk at Linux Piter 2016

Why Lisp?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 22 / 51

• Homoiconicity

• Macros

Page 23: My talk at Linux Piter 2016

Why Lisp?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 23 / 51

• Homoiconicity

• Macros

• Immutability (?)

Page 24: My talk at Linux Piter 2016

Why Lisp?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 24 / 51

• Homoiconicity

• Macros

• Immutability (?)

• Lambdas

Page 25: My talk at Linux Piter 2016

But that was not too democratic, so...

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 25 / 51

...what about Golang?

Page 26: My talk at Linux Piter 2016

Unfortunately, Golang loses

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 26 / 51

• Way too modern (uses design ideas from 1970s while Lispwas born in 1958)

Page 27: My talk at Linux Piter 2016

Unfortunately, Golang loses

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 27 / 51

• Way too modern (uses design ideas from 1970s while Lispwas born in 1958)

• Not functional enough (as in ’functional programming’)

Page 28: My talk at Linux Piter 2016

Unfortunately, Golang loses

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 28 / 51

• Way too modern (uses design ideas from 1970s while Lispwas born in 1958)

• Not functional enough (as in ’functional programming’)

• Targets Java 1.2 and PHP 4.x market share (designed forapes not humans)

Page 29: My talk at Linux Piter 2016

Runtime matters!

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 29 / 51

• Static linking is a must

Page 30: My talk at Linux Piter 2016

Runtime matters!

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 30 / 51

• Static linking is a must

• Decent GC is a must

Page 31: My talk at Linux Piter 2016

Runtime matters!

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 31 / 51

• Static linking is a must

• Decent GC is a must

• Resulting files should not be too big

Page 32: My talk at Linux Piter 2016

Runtime matters!

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 32 / 51

• Static linking is a must

• Decent GC is a must

• Resulting files should not be too big

• Let’s consider measureable things only

Page 33: My talk at Linux Piter 2016

So, Lisps then

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 33 / 51

• Common Lisp

• Scheme

Page 34: My talk at Linux Piter 2016

Common Lisp

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 34 / 51

Statically linked file is over 30Mb (Golang does around 8Mb)

Page 35: My talk at Linux Piter 2016

Scheme

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 35 / 51

Is minimalist by design (way too minimalist I’d say)

Page 36: My talk at Linux Piter 2016

So, no boots then?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 36 / 51

Page 37: My talk at Linux Piter 2016

Nim to the rescue!

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 37 / 51

Nim (formerly Nimrod)

Page 38: My talk at Linux Piter 2016

Nim: the good parts

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 38 / 51

• Strong typing

Page 39: My talk at Linux Piter 2016

Nim: the good parts

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 39 / 51

• Strong typing

• Static typing

Page 40: My talk at Linux Piter 2016

Nim: the good parts

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 40 / 51

• Strong typing

• Static typing

• Homoiconicity

Page 41: My talk at Linux Piter 2016

Nim: the good parts

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 41 / 51

• Strong typing

• Static typing

• Homoiconicity

• Macro system (hygienic)

Page 42: My talk at Linux Piter 2016

Nim: the good parts

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 42 / 51

• Strong typing

• Static typing

• Homoiconicity

• Macro system (hygienic)

• Immutability

Page 43: My talk at Linux Piter 2016

Nim: the good parts

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 43 / 51

• Strong typing

• Static typing

• Homoiconicity

• Macro system (hygienic)

• Immutability

• Templates (generics)

Page 44: My talk at Linux Piter 2016

Nim: runtime goodness

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 44 / 51

• Uses C as an IR

Page 45: My talk at Linux Piter 2016

Nim: runtime goodness

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 45 / 51

• Uses C as an IR

• Per thread GC (as in Erlang)

Page 46: My talk at Linux Piter 2016

Nim: runtime goodness

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 46 / 51

• Uses C as an IR

• Per thread GC (as in Erlang)

• Statically linked files < 1Mb (not stripped)

Page 47: My talk at Linux Piter 2016

Project Kaldur

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 47 / 51

• Means ’cold’ in Faroese

• Because it’s quite cold now

• https://github.com/alexclear/kaldur

Page 48: My talk at Linux Piter 2016

Project Kaldur

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 48 / 51

• Is live at http://185.37.61.240:5000

• Has a TODO list on Github

• Has an issues list on Github

Page 49: My talk at Linux Piter 2016

Conclusions

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 49 / 51

• TeX is great!

• Nim is great too!

• Flamegraphs are great!

• Linux is great!

• Open source projects are great!

Page 50: My talk at Linux Piter 2016

Questions, please?

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 50 / 51

• Why FP?

• Why Linux?

• ...?

Page 51: My talk at Linux Piter 2016

So long, and thanks for all the fish

Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 51 / 51

[email protected]

• https://telegram.me/lhommequipleure