My talk at Linux Piter 2016
-
Upload
alex-chistyakov -
Category
Technology
-
view
1.440 -
download
0
Transcript of My talk at Linux Piter 2016
![Page 1: My talk at Linux Piter 2016](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/1.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/2.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/3.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/4.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/5.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/6.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/7.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/8.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/9.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/10.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/11.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/12.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/13.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/14.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/15.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/16.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/17.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/18.jpg)
A hicker needs good boots
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 18 / 51
![Page 19: My talk at Linux Piter 2016](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/19.jpg)
So, we need a language
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 19 / 51
![Page 20: My talk at Linux Piter 2016](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/20.jpg)
The obvious choice
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 20 / 51
![Page 21: My talk at Linux Piter 2016](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/21.jpg)
Why Lisp?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 21 / 51
• Homoiconicity
![Page 22: My talk at Linux Piter 2016](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/22.jpg)
Why Lisp?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 22 / 51
• Homoiconicity
• Macros
![Page 23: My talk at Linux Piter 2016](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/23.jpg)
Why Lisp?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 23 / 51
• Homoiconicity
• Macros
• Immutability (?)
![Page 24: My talk at Linux Piter 2016](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/24.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/25.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/26.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/27.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/28.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/29.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/30.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/31.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/32.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/33.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/34.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/35.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/36.jpg)
So, no boots then?
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 36 / 51
![Page 37: My talk at Linux Piter 2016](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/37.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/38.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/39.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/40.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/41.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/42.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/43.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/44.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/45.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/46.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/47.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/48.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/49.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/50.jpg)
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](https://reader030.fdocuments.in/reader030/viewer/2022021507/5872cdb21a28ab74188b46d5/html5/thumbnails/51.jpg)
So long, and thanks for all the fish
Alex Chistyakov, DataArt Gathering and visualizing flamegraphs in realtime 51 / 51
• https://telegram.me/lhommequipleure