SlideShare a Scribd company logo
© 2018 InfluxData. All rights reserved.1
Distributed Performance Analysis
Using InfluxDB and the Linux
eBPF Virtual Machine
eBPF (extended BPF)
Extended Berkeley Packet Filter
© 2018 InfluxData. All rights reserved.3
BPF is a Tracing Framework*
Used to access kernel trace backend instrumentation tools
*Actually, it’s not just that. And there’s also XDP.
© 2018 InfluxData. All rights reserved.4
Static tracepoints
# cat /sys/kernel/debug/tracing/available_events
sched:
task:
signal:
timer:
workqueue:
irq:
kvm:
# ls /sys/kernel/debug/tracing/events/irq/
enable filter irq_handler_entry
irq_handler_exit softirq_entry softirq_exit
softirq_raise
tcp:
© 2018 InfluxData. All rights reserved.5
Dynamic trace functionalities
uprobes kprobes
XDP
© 2018 InfluxData. All rights reserved.6
eBPF program lifecycle
Kernel space User space
User program
eBPF bytecode
Static verifier
BPF
BPF_MAP_* Results
(bpf_lookup_elem)
uprobes
kprobes
tracepoints
BPF_PROG_LOAD
see man 2 bpf
The mustache parrot warns!
eBPF programs can’t be turing complete!
XDP
socketfilter
In today’s world
© 2018 InfluxData. All rights reserved.8
In today’s world: tcpdump
Documentation about the instruction set: https://www.kernel.org/doc/Documentation/networking/filter.txt
# tcpdump -d 'ip and tcp port 80'
(000) ldh [12]
(001) jeq #0x800 jt 2 jf 12
(002) ldb [23]
(003) jeq #0x6 jt 4 jf 12
(004) ldh [20]
(005) jset #0x1fff jt 12 jf 6
(006) ldxb 4*([14]&0xf)
(007) ldh [x + 14]
(008) jeq #0x50 jt 11 jf 9
(009) ldh [x + 16]
(010) jeq #0x50 jt 11 jf 12
(011) ret #262144
(012) ret #0
-d stands for: Dump the compiled packet-matching code in a human readable form to standard output and stop.
Is src (x+14) on port 80 (0x50)?
Is src (x+16) on port 80 (0x50)?
Is it an ethernet IP IPv4 packet?
In today’s world: seccomp
gcc -lseccomp seccomp-test.c
./a.out
hey there!
something's gonna happen!!
[1] 19463 killed ./a.out
© 2018 InfluxData. All rights reserved.10
10
More practical examples?
¨ Trace file opens by filename
¨ Trace queries done against a database, like InfluxDB or MySQL
¨ Trace TCP retransmissions
¨ Trace all commands done in a bash shell
¨ Trace block device I/O latency over time
¨ JVM events
¨ Go Runtime Events
¨ Firewalls, packet rewriting, dropping etc..
High-level APIs are there!
© 2018 InfluxData. All rights reserved.12
Write every executed bash command to Influx
Kernel space User space
main.go
eBPF bytecode
Static verifier
BPF
BPF_PERF_OUTPUT Results
(bpf_open_perf_buffer)
uretprobe
get_return_value
BPF_PROG_LOAD LLVM Backend “ebpf”
Results channel
Results consumer
consumes
writes
Populates the channel
Populates the userspace map
© 2018 InfluxData. All rights reserved.13
As a Daemonset in a Kubernetes Cluster!
Kernel space (for privileged POD) Pod User space
main.go
eBPF bytecode
Static verifier
BPF
BPF_PERF_OUTPUT Results
(bpf_open_perf_buffer)
uretprobe
get_return_value
BPF_PROG_LOAD LLVM Backend “ebpf”
Results channel
Results consumer
consumes
writes
Populates the channel
Populates the userspace map
© 2018 InfluxData. All rights reserved.14
© 2018 InfluxData. All rights reserved.15
© 2018 InfluxData. All rights reserved.16
References
1. https://www.iovisor.org/
2. https://github.com/cilium/cilium
3. https://github.com/iovisor/gobpf
4. https://landlock.io/
5. https://github.com/iovisor/bpftrace
6. https://github.com/iovisor/bpf-docs
7. https://medium.com/@fntlnz/load-xdp-programs-using-the-ip-iproute2-command-502043898263
8. https://www.youtube.com/watch?v=JRFNIKUROPE
9. https://cilium.readthedocs.io/en/latest/bpf/
1. iovisor BCC
2. Cilium: HTTP, gRPC, and Kafka Aware Security and Networking for Containers with BPF and XDP
3. iovisor/gobpf - To load eBPF programs using Go
4. Landlock LSM
5. iovisor bpftrace
6. iovisor BPF docs
7. Blog post on how to load xdp programs using iproute2
8. BPF Tracing Talk from Brendan Gregg
9. Cilium documentation for BPF
Thank you!lorenzo@influxdata.com
twitter.com/fntlnz
github.com/fntlnz
If you’re that kind of person can find my pgp key here:
https://fntlnz.wtf/downloads/pubkey-B2400EE4.asc

More Related Content

PDF
Intro to Kapacitor for Alerting and Anomaly Detection
PDF
InfluxDB & Kubernetes
PDF
OPTIMIZING THE TICK STACK
PPTX
Kapacitor - Real Time Data Processing Engine
PDF
Virtual training Intro to InfluxDB & Telegraf
PDF
Finding OOMS in Legacy Systems with the Syslog Telegraf Plugin
PDF
Write your own telegraf plugin
PDF
How to Build a Telegraf Plugin by Noah Crowley
Intro to Kapacitor for Alerting and Anomaly Detection
InfluxDB & Kubernetes
OPTIMIZING THE TICK STACK
Kapacitor - Real Time Data Processing Engine
Virtual training Intro to InfluxDB & Telegraf
Finding OOMS in Legacy Systems with the Syslog Telegraf Plugin
Write your own telegraf plugin
How to Build a Telegraf Plugin by Noah Crowley

What's hot (20)

PPTX
Building Modern Data Pipelines for Time Series Data on GCP with InfluxData by...
PDF
Getting Ready to Move to InfluxDB 2.0 | Tim Hall | InfluxData
PDF
Escape the Walls of PaaS: Unlock the Power & Flexibility of DigitalOcean App ...
PDF
Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...
PPTX
Scaling Prometheus Metrics in Kubernetes with Telegraf | Chris Goller | Influ...
PDF
Flink Forward Berlin 2017: Roberto Bentivoglio, Saverio Veltri - NSDB (Natura...
PDF
The Telegraf Toolbelt | David McKay | InfluxData
PDF
Combining Cloud Native & PaaS: Building a Fully Managed Application Platform ...
PPTX
Extending Flux - Writing Your Own Functions by Adam Anthony
PDF
Flink Forward Berlin 2017: Francesco Versaci - Integrating Flink and Kafka in...
PDF
Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...
PDF
Flink Forward San Francisco 2019: Massive Scale Data Processing at Netflix us...
PPTX
Wayfair Storefront Performance Monitoring with InfluxEnterprise by Richard La...
PDF
Creating and Using the Flux SQL Datasource | Katy Farmer | InfluxData
PPTX
Intro to InfluxDB 2.0 and Your First Flux Query by Sonia Gupta
PDF
How to Build a Monitoring Application in 20 Minutes | Russ Savage | InfluxData
PPTX
Influx data basic
PDF
Flink Forward Berlin 2017: Andreas Kunft - Efficiently executing R Dataframes...
PDF
Best Practices for Scaling an InfluxEnterprise Cluster
PPTX
InfluxDB Client Libraries and Applications | Miroslav Malecha | Bonitoo
Building Modern Data Pipelines for Time Series Data on GCP with InfluxData by...
Getting Ready to Move to InfluxDB 2.0 | Tim Hall | InfluxData
Escape the Walls of PaaS: Unlock the Power & Flexibility of DigitalOcean App ...
Flink Forward Berlin 2017: Aljoscha Krettek - Talk Python to me: Stream Proce...
Scaling Prometheus Metrics in Kubernetes with Telegraf | Chris Goller | Influ...
Flink Forward Berlin 2017: Roberto Bentivoglio, Saverio Veltri - NSDB (Natura...
The Telegraf Toolbelt | David McKay | InfluxData
Combining Cloud Native & PaaS: Building a Fully Managed Application Platform ...
Extending Flux - Writing Your Own Functions by Adam Anthony
Flink Forward Berlin 2017: Francesco Versaci - Integrating Flink and Kafka in...
Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...
Flink Forward San Francisco 2019: Massive Scale Data Processing at Netflix us...
Wayfair Storefront Performance Monitoring with InfluxEnterprise by Richard La...
Creating and Using the Flux SQL Datasource | Katy Farmer | InfluxData
Intro to InfluxDB 2.0 and Your First Flux Query by Sonia Gupta
How to Build a Monitoring Application in 20 Minutes | Russ Savage | InfluxData
Influx data basic
Flink Forward Berlin 2017: Andreas Kunft - Efficiently executing R Dataframes...
Best Practices for Scaling an InfluxEnterprise Cluster
InfluxDB Client Libraries and Applications | Miroslav Malecha | Bonitoo
Ad

Similar to DISTRIBUTED PERFORMANCE ANALYSIS USING INFLUXDB AND THE LINUX EBPF VIRTUAL MACHINE (20)

PDF
eBPF Powered Distributed Kubernetes Performance Analysis - Lorenzo Fontana, I...
PDF
UM2019 Extended BPF: A New Type of Software
PDF
Systems@Scale 2021 BPF Performance Getting Started
PDF
Performance Wins with eBPF: Getting Started (2021)
PDF
Introduction of eBPF - 時下最夯的Linux Technology
PDF
Efficient System Monitoring in Cloud Native Environments
PDF
BPF: Tracing and more
PDF
Security Monitoring with eBPF
PDF
USENIX ATC 2017 Performance Superpowers with Enhanced BPF
PDF
Andrea Righi - Spying on the Linux kernel for fun and profit
PDF
Spying on the Linux kernel for fun and profit
PDF
Linux 4.x Tracing Tools: Using BPF Superpowers
PPTX
Understanding eBPF in a Hurry!
PDF
Linux BPF Superpowers
PDF
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
PDF
Kernel bug hunting
PPTX
eBPF Basics
PDF
Bpf performance tools chapter 4 bcc
PDF
Velocity 2017 Performance analysis superpowers with Linux eBPF
PDF
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
eBPF Powered Distributed Kubernetes Performance Analysis - Lorenzo Fontana, I...
UM2019 Extended BPF: A New Type of Software
Systems@Scale 2021 BPF Performance Getting Started
Performance Wins with eBPF: Getting Started (2021)
Introduction of eBPF - 時下最夯的Linux Technology
Efficient System Monitoring in Cloud Native Environments
BPF: Tracing and more
Security Monitoring with eBPF
USENIX ATC 2017 Performance Superpowers with Enhanced BPF
Andrea Righi - Spying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profit
Linux 4.x Tracing Tools: Using BPF Superpowers
Understanding eBPF in a Hurry!
Linux BPF Superpowers
OSSNA 2017 Performance Analysis Superpowers with Linux BPF
Kernel bug hunting
eBPF Basics
Bpf performance tools chapter 4 bcc
Velocity 2017 Performance analysis superpowers with Linux eBPF
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Ad

More from InfluxData (20)

PPTX
Announcing InfluxDB Clustered
PDF
Best Practices for Leveraging the Apache Arrow Ecosystem
PDF
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
PDF
Power Your Predictive Analytics with InfluxDB
PDF
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
PDF
Build an Edge-to-Cloud Solution with the MING Stack
PDF
Meet the Founders: An Open Discussion About Rewriting Using Rust
PDF
Introducing InfluxDB Cloud Dedicated
PDF
Gain Better Observability with OpenTelemetry and InfluxDB
PPTX
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
PDF
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
PPTX
Introducing InfluxDB’s New Time Series Database Storage Engine
PDF
Start Automating InfluxDB Deployments at the Edge with balena
PDF
Understanding InfluxDB’s New Storage Engine
PDF
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
PPTX
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
PDF
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
PDF
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
PDF
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
PDF
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Announcing InfluxDB Clustered
Best Practices for Leveraging the Apache Arrow Ecosystem
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
Power Your Predictive Analytics with InfluxDB
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
Build an Edge-to-Cloud Solution with the MING Stack
Meet the Founders: An Open Discussion About Rewriting Using Rust
Introducing InfluxDB Cloud Dedicated
Gain Better Observability with OpenTelemetry and InfluxDB
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
Introducing InfluxDB’s New Time Series Database Storage Engine
Start Automating InfluxDB Deployments at the Edge with balena
Understanding InfluxDB’s New Storage Engine
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022

Recently uploaded (20)

PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPTX
presentation_pfe-universite-molay-seltan.pptx
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
DOCX
Unit-3 cyber security network security of internet system
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PDF
Testing WebRTC applications at scale.pdf
PDF
Introduction to the IoT system, how the IoT system works
PPTX
Digital Literacy And Online Safety on internet
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PDF
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
PPTX
Internet___Basics___Styled_ presentation
PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
PPTX
Funds Management Learning Material for Beg
PPTX
international classification of diseases ICD-10 review PPT.pptx
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
SASE Traffic Flow - ZTNA Connector-1.pdf
presentation_pfe-universite-molay-seltan.pptx
Tenda Login Guide: Access Your Router in 5 Easy Steps
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
Unit-3 cyber security network security of internet system
INTERNET------BASICS-------UPDATED PPT PRESENTATION
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
Unit-1 introduction to cyber security discuss about how to secure a system
Module 1 - Cyber Law and Ethics 101.pptx
Testing WebRTC applications at scale.pdf
Introduction to the IoT system, how the IoT system works
Digital Literacy And Online Safety on internet
Introuction about WHO-FIC in ICD-10.pptx
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
Internet___Basics___Styled_ presentation
Cloud-Scale Log Monitoring _ Datadog.pdf
Funds Management Learning Material for Beg
international classification of diseases ICD-10 review PPT.pptx

DISTRIBUTED PERFORMANCE ANALYSIS USING INFLUXDB AND THE LINUX EBPF VIRTUAL MACHINE

  • 1. © 2018 InfluxData. All rights reserved.1 Distributed Performance Analysis Using InfluxDB and the Linux eBPF Virtual Machine
  • 2. eBPF (extended BPF) Extended Berkeley Packet Filter
  • 3. © 2018 InfluxData. All rights reserved.3 BPF is a Tracing Framework* Used to access kernel trace backend instrumentation tools *Actually, it’s not just that. And there’s also XDP.
  • 4. © 2018 InfluxData. All rights reserved.4 Static tracepoints # cat /sys/kernel/debug/tracing/available_events sched: task: signal: timer: workqueue: irq: kvm: # ls /sys/kernel/debug/tracing/events/irq/ enable filter irq_handler_entry irq_handler_exit softirq_entry softirq_exit softirq_raise tcp:
  • 5. © 2018 InfluxData. All rights reserved.5 Dynamic trace functionalities uprobes kprobes XDP
  • 6. © 2018 InfluxData. All rights reserved.6 eBPF program lifecycle Kernel space User space User program eBPF bytecode Static verifier BPF BPF_MAP_* Results (bpf_lookup_elem) uprobes kprobes tracepoints BPF_PROG_LOAD see man 2 bpf The mustache parrot warns! eBPF programs can’t be turing complete! XDP socketfilter
  • 8. © 2018 InfluxData. All rights reserved.8 In today’s world: tcpdump Documentation about the instruction set: https://www.kernel.org/doc/Documentation/networking/filter.txt # tcpdump -d 'ip and tcp port 80' (000) ldh [12] (001) jeq #0x800 jt 2 jf 12 (002) ldb [23] (003) jeq #0x6 jt 4 jf 12 (004) ldh [20] (005) jset #0x1fff jt 12 jf 6 (006) ldxb 4*([14]&0xf) (007) ldh [x + 14] (008) jeq #0x50 jt 11 jf 9 (009) ldh [x + 16] (010) jeq #0x50 jt 11 jf 12 (011) ret #262144 (012) ret #0 -d stands for: Dump the compiled packet-matching code in a human readable form to standard output and stop. Is src (x+14) on port 80 (0x50)? Is src (x+16) on port 80 (0x50)? Is it an ethernet IP IPv4 packet?
  • 9. In today’s world: seccomp gcc -lseccomp seccomp-test.c ./a.out hey there! something's gonna happen!! [1] 19463 killed ./a.out
  • 10. © 2018 InfluxData. All rights reserved.10 10 More practical examples? ¨ Trace file opens by filename ¨ Trace queries done against a database, like InfluxDB or MySQL ¨ Trace TCP retransmissions ¨ Trace all commands done in a bash shell ¨ Trace block device I/O latency over time ¨ JVM events ¨ Go Runtime Events ¨ Firewalls, packet rewriting, dropping etc..
  • 12. © 2018 InfluxData. All rights reserved.12 Write every executed bash command to Influx Kernel space User space main.go eBPF bytecode Static verifier BPF BPF_PERF_OUTPUT Results (bpf_open_perf_buffer) uretprobe get_return_value BPF_PROG_LOAD LLVM Backend “ebpf” Results channel Results consumer consumes writes Populates the channel Populates the userspace map
  • 13. © 2018 InfluxData. All rights reserved.13 As a Daemonset in a Kubernetes Cluster! Kernel space (for privileged POD) Pod User space main.go eBPF bytecode Static verifier BPF BPF_PERF_OUTPUT Results (bpf_open_perf_buffer) uretprobe get_return_value BPF_PROG_LOAD LLVM Backend “ebpf” Results channel Results consumer consumes writes Populates the channel Populates the userspace map
  • 14. © 2018 InfluxData. All rights reserved.14
  • 15. © 2018 InfluxData. All rights reserved.15
  • 16. © 2018 InfluxData. All rights reserved.16 References 1. https://www.iovisor.org/ 2. https://github.com/cilium/cilium 3. https://github.com/iovisor/gobpf 4. https://landlock.io/ 5. https://github.com/iovisor/bpftrace 6. https://github.com/iovisor/bpf-docs 7. https://medium.com/@fntlnz/load-xdp-programs-using-the-ip-iproute2-command-502043898263 8. https://www.youtube.com/watch?v=JRFNIKUROPE 9. https://cilium.readthedocs.io/en/latest/bpf/ 1. iovisor BCC 2. Cilium: HTTP, gRPC, and Kafka Aware Security and Networking for Containers with BPF and XDP 3. iovisor/gobpf - To load eBPF programs using Go 4. Landlock LSM 5. iovisor bpftrace 6. iovisor BPF docs 7. Blog post on how to load xdp programs using iproute2 8. BPF Tracing Talk from Brendan Gregg 9. Cilium documentation for BPF
  • 17. Thank you!lorenzo@influxdata.com twitter.com/fntlnz github.com/fntlnz If you’re that kind of person can find my pgp key here: https://fntlnz.wtf/downloads/pubkey-B2400EE4.asc