Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Exploring BEAM-based systems with erlang.pl

Exploring BEAM-based systems with erlang.pl

Processes running on the BEAM virtual machine share data through message passing. If certain processes receive more messages than they can handle, their inbox queue starts growing. Over time it can lead to bottlenecks. Similarly distributed systems share data through network packets sent between nodes and in some cases it can lead to network congestions. Gaining visibility into message passing and network traffic is of great importance as it helps to understand the behaviour of the entire system.

During this talk we will explore the behaviour of two systems under load - one based on Erlang (MongooseIM) and one based on Elixir (Phoenix Channels). We will demonstrate the erlang.pl tool and observe if its graphical representation of processes and clustering can help us learn something about the characteristics of the two systems.

Videos used in the presentation:
Phoenix Channels cluster view - https://www.youtube.com/watch?v=ybnQ0rre1Jc
Phoenix Channels node view - https://www.youtube.com/watch?v=ZD5WwGsBA7Q
MongooseIM cluster view - https://www.youtube.com/watch?v=BIbLOVNKZYw

Michał Ślaski

June 28, 2017
Tweet

More Decks by Michał Ślaski

Other Decks in Programming

Transcript

  1. WHY BEAM • BEAM benefits relevant today: • concise code

    • reliable system • equal latency for all users
  2. WHY BEAM • BEAM benefits relevant today: • concise code

    • reliable system • equal latency for all users • utilisation of multi core CPUs
  3. WHY BEAM • BEAM benefits relevant today: • concise code

    • reliable system • equal latency for all users • utilisation of multi core CPUs • traceability
  4. WHAT IS ERLANG.PL • Tool for the BEAM platform (a.k.a.

    Erlang VM) • Helps with system exploration
  5. WHAT IS ERLANG.PL • Tool for the BEAM platform (a.k.a.

    Erlang VM) • Helps with system exploration • Exploits benefits of traceability
  6. WHAT IS ERLANG.PL • Tool for the BEAM platform (a.k.a.

    Erlang VM) • Helps with system exploration • Exploits benefits of traceability • Aims at facilitating developer's work
  7. HISTORY • Proof of concept in Jun 2013 • Open

    source since Feb 2017 • Presented in Mar 2017 at EEF SF
  8. HISTORY • Proof of concept in Jun 2013 • Open

    source since Feb 2017 • Presented in Mar 2017 at EEF SF • Accepted for Google Summer of Code'2017
  9. WORKFLOW - STEP 1 • observe dashboard • look for

    trends • observe that
 message traffic
 has increased
  10. WORKFLOW - STEP 1 • observe dashboard • look for

    trends • observe that
 message traffic
 has increased • what is the root cause?
  11. WORKFLOW - STEP 2 if the root cause is external,

    we observe increased
 traffic from external nodes
  12. WORKFLOW - STEP 3 if the root cause is internal,

    we observe increased traffic
 between internal processes
  13. WORKFLOW - STEP 4 • view the supervision tree •

    find the process generating
 a lot of internal traffic
  14. WORKFLOW - STEP 4 • view the supervision tree •

    find the process generating
 a lot of internal traffic • get to know its process_info/1
  15. WORKFLOW - STEP 5 • analyse the process' mailbox •

    observe the ordering of messages inspect how processing a message changed the state
  16. WORKFLOW - STEP 6 • inspect a flame graph •

    what keeps it busy? • where most of the time is spent?
  17. DESIGN PRINCIPLES • Intuitive navigation and visualisations • Simplify complex

    sets of trace events • Don't worry about production systems
  18. DESIGN PRINCIPLES • Intuitive navigation and visualisations • Simplify complex

    sets of trace events • Don't worry about production systems • Leverage WebGL as much as possible
  19. WHAT IS AVAILABLE • Dashboard, cluster, message passing and supervision

    tree views already implemented • Timeline tracking is work in progress
  20. HOW IT WORKS • spawn remote fun()
 
 
 •

    turn on tracer for all processes
  21. HOW IT WORKS • spawn remote fun()
 
 
 •

    turn on tracer for all processes