SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Downloaden Sie, um offline zu lesen
An Embedded Soft Real
Time System in Go
Mirko Damiani
Software Engineer @ Develer
LinuxLab 3-4 Dec 2018
Overview
● Soft real time systems
● Our hardware/software solution
● Go advantages for embedded
● Go optimizations
Soft Real Time System
● Industrial machines
● Quality features
○ Color
○ Weight
○ Defects
○ Shape
○ ...
● Classification
○ Grouping items together,
according to quality features
Quality Classifier
Photo by Kate Buckley on flickr
Industrial Applications
Photo by SortingExpert on WikipediaPhoto from prozesstechnik
Specs & Outline
● 100 lanes
● 20 items/sec per lane
● 2000 items/sec
● 10 exits per lane
● Industrial scale
Photo by Chris Chadd from Pexels
Feeder
Sensor
Exit
Lane
Rotary
Encoder
Ejector
Classify
Need of Precision
● Items are eventually ejected
○ Precise timing of ejection
○ Precision of 250 us
○ Multiple exits
● Usually real time OS are used
○ Higher determinism
Hardware Architecture
Our Machine Layout
IO IO
exit 1 exit 2
ejectorssensors
BL
data in data out
checkpoint
● Boards
○ BL: Business Logic
○ IO: Input/Output
● Business Logic
○ Acquires data from sensors
○ Manages every lane
● Network traffic is heavy
○ Up to 250 sensors
○ Up to 2000 items per second
● Checkpoint
○ Trigger for classification
The Challenge
Canonical Way
● RTOS kernel
● Custom hardware & boards
● CANBUS communication
● Single board
● Firmware C bare metal
The Challenge: Linux and Go
Canonical Way
● RTOS kernel
● Custom hardware & boards
● CANBUS communication
● Single board
● Firmware C bare metal
Our Solution
● GNU/Linux standard kernel
● Hardware standard components
● Ethernet based communication
● Distributed system
● Go language
Why Linux?
GNU/Linux
● Real time processes
● Microprocessor boards
● No Safety Certifications
● Plenty of Drivers
● Separation of competences
● Debug on desktop with tools
● Many Languages & Libraries
RTOS
● Tasks with priorities
● Microcontrollers (no MMU)
● Safety and Certifications
● Limited number of Drivers
● Single big application
● Debug on hardware boards
● Few Languages and Libraries
Network connections
● “BL” Single Business Logic board
○ Freescale i.MX 6, Quad Core ARM Cortex A9 @ 1.2 GHz
○ Performs the items classification for every lane
● “IO” Multiple Input/Output boards
○ Develboard Atmel, Single Core ARM @ 600 MHz
○ Digital inputs and outputs
● Multiple sensor sensors
● Ethernet bus with standard switches/routers
BL
IO IO IO
Ethernet
Switch
Star topology
Different topology with Linux Sw bridge
BL
IO IO IO
BL
IO IO IO
Star topology
Serial topology
● Simplified cabling
● Sw bridge: 15% CPU
Latency for Soft Real Time
● Kernel driver with a precision of 250 us
○ DMA + double buffering
○ Buffer has a duration of 100 ms
○ Actual precision of 66 us
● Queue of scheduled activations
○ User space software writes activations to the kernel driver
● Soft real time latency
○ 100 ms + queue management ~= 150 ms
○ System can’t react faster than 150 ms (e.g. change of speed)
Rotary encoder
● Lanes are physically bound
○ Multiple encoders in case of
big machines
● Encoder steps
○ Square waves
○ 2000 steps/round
● Kernel driver
○ Parameters exported in sysfs
A
B
Z
Linear Interpolation
● We cannot synchronize thousands
times per second with Ethernet
● Synchronization every 100 ms
● Linear interpolation
○ Encoder accelerations are “slow” because
it’s bound to a mechanical transport
● Workaround of a real time protocol
t
#step
● Real curve
● Interpolated curve
BL/IO Clock Synchronization
● Activation messages are marked with a specific timestamp
○ We need to synchronize clocks
● Usually, NTP is used
○ Precision of ~milliseconds => Not enough for us
○ We need a precision of (at least) 250 us
● Precision Time Protocol IEEE 1585 (PTP)
● Two PTP timestamping models: Hardware or Software
○ Software timestamping: Kernel interrupt => Precision of ~microseconds
○ Hardware timestamping: Ethernet interface => Precision of ~nanoseconds
○ Develboard supports IEEE 1858, but software timestamping is enough
Go for Embedded
Basic Advantages
● Simple language, clients got used to it very quickly
● Simple documentation and maintenance
● Static binaries
● Large ecosystem of libraries
● Concurrent programming
● Easy cross compilation
○ Embedded (ARM)
○ Windows
○ Linux
Embedded: Go vs C++
● Stack trace and data race analysis
○ Valgrind slows down performance
● Debug tools
○ Remote debugging and system analysis (gdb vs pprof)
● Linter and code analysis
○ Easier to integrate static analysis tools (e.g. golint, go vet)
● Tags (go build -tags …)
○ Useful for embedded apps and stubs
○ Cleaner approach compared to #ifdef
Fine tuning: Disassembly
● go tool objdump -s main.join -S <binary_name>
func join(strings []string) string {
0x8bae0 e59a1008 MOVW 0x8(R10), R1
0x8bae4 e15d0001 CMP R1, R13
0x8bae8 9a00001a B.LS 0x8bb58
e 0x8baec e52de024 MOVW.W R14, -0x24(R13)
0x8baf0 e3a00000 MOVW $0, R0
0x8baf4 e3a01000 MOVW $0, R1
0x8baf8 e3a02000 MOVW $0, R2
for _, str := range strings {
0x8bafc ea00000f B 0x8bb40
0x8bb00 e58d0020 MOVW R0, 0x20(R13)
0x8bb04 e59d3028 MOVW 0x28(R13), R3
0x8bb08 e7934180 MOVW (R3)(R0<<3), R4
0x8bb0c e0835180 ADD R0<<$3, R3, R5
0x8bb10 e5955004 MOVW 0x4(R5), R5
package main
import (
"fmt"
"os"
)
func join(strings []string) string {
var ret string
for _, str := range strings {
ret += str
}
return ret
}
func main() {
fmt.Println(join(os.Args[1:]))
}
How do we perform tests on Embedded?
1. Unit tests
2. Full integration tests
○ Integration framework
○ Mocking board/instruments as Goroutines
○ Easier than C++
○ Fast prototyping for tests
3. Continuous integration
○ The real embedded system was simulated on CircleCI
● Monitoring of performance
○ Metrics
○ Profiling
● Google pprof upstream version:
○ go get -u github.com/google/pprof
● Small CPU profile file => 10 minutes execution => just 185 KiB
○ Stand alone, no binary
○ Can read from both local file or over HTTP
○ pprof -http :8081 http://localhost:8080/debug/pprof/profile?seconds=30
Avoid Performance Regression
Hardware in the Loop
● Automatic performance monitoring
● We have a real hardware test bench
● We want to deploy our system
directly to the test bench
● Results from the test bench
are retrieved by CircleCI
Repo
CI
Metrics
Hardware
Remote Introspection via Browser
● Uncommon in embedded apps
● Expvar
○ Standard interface for public variables
○ Exports figures about the program
○ JSON format
// At global scope
var requestCount = expvar.NewInt("RequestCount")
...
func myHandler(w http.ResponseWriter, r *http.Request) {
requestCount.Add(1)
...
}
Go Optimizations
Metrics
● Performance analysis
○ We don’t want performance regressions
○ Refactoring
○ Test suites don’t help
● “Tachymeter” library to monitor metrics
○ Low impact, samples are added to a circular buffer
○ Average, Standard Deviation, Percentiles, Min, Max, …
● Multiple outputs
○ Formatted string, JSON string, Histogram text and html
○ HTTP endpoint for remote analysis
Checkpoint Margin
● Average
○ Avg 2.301660948s
○ StdDev 176.75148ms
● Percentiles
○ P75 2.222552667s
○ P95 1.921699001s
○ P99 1.721095s
○ P999 1.575430001s
● Limits
○ Max 2.916016667s
○ Min 1.464427001s
checkpointsensors
margin
activation
2 minutes run
How is Checkpoint Margin affected?
● I/O bound
● Reading packets from connections
● We need to read fairly from 250 tcp sockets
eth/tcpBL
S
S
S
Standard Network Loop
● One Goroutine per connection
○ 1. Read data from network
○ 2. Decode packets
○ 3. Send to main loop via channel
● chan packet
○ Sending one packet at time
to the main loop
● Can we do better?
main
loop
TCP
gorunTCP
gorunTCP
gorunTCP
Read
chan
packet
Concurrent
Goroutines
Batched Channel
● chan packet vs chan []packet
○ Sending one packet at time
is too slow
● Use a single channel write
operation to send all packets
received from a single TCP read
○ Minimizing channel writes is good
main
loop
TCP
gorunTCP
gorunTCP
gorunTCP
Read
chan
[ ]packet
Concurrent
Goroutines
Number of Channel Writes
● Channel
○ Buffered
○ Slice of packets
● Writes per second
○ 2000 → 25000 w/s
● Total GC STW time
○ 2.28 → 11.50 s
Channel Writes per Second [w/s]
● Checkpoint Margin [s]
● GC Time [s]
2 minutes run
Failed Test: Using a Mutex
● Goroutines will block on a mutex
○ High contention
○ Go scheduler is cooperative
● Deadline missed
○ Checkpoint event is delayed
● Conn.Read(): Channel Mutex
○ Min 13 us 13 us
○ Max 773 us 1.15 s
○ P99 64 us 510 ms
● Activation margin: Channel Mutex
○ P99 466 ms -1.13 s
main
loop
TCP
gorunTCP
gorunTCP
gorunTCP
Read
mutex
checkpoint
margin
activation
delay
Alternative: Using EPOLL
● EPOLL syscall allows to use
a single Goroutine
● MultiReader Go interface
○ Reading from multiple connections
○ Monitoring of multiple file descriptors
● Drawbacks
○ It can’t be used on Windows
○ Cannot use net.Socket
○ Maintenance
main
loop
TCP
Multi
Read
type MultiPacketReader interface {
// TCP connection with framing
Register(conn PacketConn)
// Reads from one of the
// registered connections
ReadPackets(packets [][]byte)
(n int, conn PacketConn, err error)
}
chan
[ ]packet
CPU Usage: EPOLL VS Go
● 4 CPUs in total
○ Graph shows just one CPU
(for simplicity)
● Go impl
○ CPU usage is higher...
○ … but more “uniform”
● EPOLL impl
○ CPU cores are switched
more frequently
● EPOLL
● Go
Time (2 minutes)
Conclusions
Thanks
mirko@develer.com
● Standard Linux OS and hardware
○ Faster development
○ Distributed system
● Testing and monitoring
○ Fast prototyping for tests
○ Profiling and metrics
○ Performance tests on real hardware
● Optimizations
○ Goroutines management
○ Packets reception
● Drawbacks
○ GC impact must be reduced
○ Mutex contention can be a problem
○ Network APIs are not flexible enough
● Go can be used for embedded apps!

Weitere ähnliche Inhalte

Was ist angesagt?

Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Linaro
 
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120Linaro
 
BKK16-103 OpenCSD - Open for Business!
BKK16-103 OpenCSD - Open for Business!BKK16-103 OpenCSD - Open for Business!
BKK16-103 OpenCSD - Open for Business!Linaro
 
LAS16-100K1: Welcome Keynote
LAS16-100K1: Welcome KeynoteLAS16-100K1: Welcome Keynote
LAS16-100K1: Welcome KeynoteLinaro
 
Kernel Recipes 2016 - New hwmon device registration API - Jean Delvare
Kernel Recipes 2016 -  New hwmon device registration API - Jean DelvareKernel Recipes 2016 -  New hwmon device registration API - Jean Delvare
Kernel Recipes 2016 - New hwmon device registration API - Jean DelvareAnne Nicolas
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageKernel TLV
 
BKK16-304 The State of GDB on AArch64
BKK16-304 The State of GDB on AArch64BKK16-304 The State of GDB on AArch64
BKK16-304 The State of GDB on AArch64Linaro
 
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and ApproachesBUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and ApproachesLinaro
 
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from HellLAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from HellLinaro
 
Davide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruptionDavide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruptionlinuxlab_conf
 
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...linuxlab_conf
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLinaro
 
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...linuxlab_conf
 
LAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android NLAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android NLinaro
 
Deploy STM32 family on Zephyr - SFO17-102
Deploy STM32 family on Zephyr - SFO17-102Deploy STM32 family on Zephyr - SFO17-102
Deploy STM32 family on Zephyr - SFO17-102Linaro
 
ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!Affan Syed
 
LAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel AwarenessLAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel AwarenessLinaro
 
Kernel Recipes 2016 - Landlock LSM: Unprivileged sandboxing
Kernel Recipes 2016 - Landlock LSM: Unprivileged sandboxingKernel Recipes 2016 - Landlock LSM: Unprivileged sandboxing
Kernel Recipes 2016 - Landlock LSM: Unprivileged sandboxingAnne Nicolas
 
LAS16-405:OpenDataPlane: Software Defined Dataplane leader
LAS16-405:OpenDataPlane: Software Defined Dataplane leaderLAS16-405:OpenDataPlane: Software Defined Dataplane leader
LAS16-405:OpenDataPlane: Software Defined Dataplane leaderLinaro
 

Was ist angesagt? (20)

Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
 
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
 
BKK16-103 OpenCSD - Open for Business!
BKK16-103 OpenCSD - Open for Business!BKK16-103 OpenCSD - Open for Business!
BKK16-103 OpenCSD - Open for Business!
 
LAS16-100K1: Welcome Keynote
LAS16-100K1: Welcome KeynoteLAS16-100K1: Welcome Keynote
LAS16-100K1: Welcome Keynote
 
Kernel Recipes 2016 - New hwmon device registration API - Jean Delvare
Kernel Recipes 2016 -  New hwmon device registration API - Jean DelvareKernel Recipes 2016 -  New hwmon device registration API - Jean Delvare
Kernel Recipes 2016 - New hwmon device registration API - Jean Delvare
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
BKK16-304 The State of GDB on AArch64
BKK16-304 The State of GDB on AArch64BKK16-304 The State of GDB on AArch64
BKK16-304 The State of GDB on AArch64
 
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and ApproachesBUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
 
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from HellLAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
 
Davide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruptionDavide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruption
 
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
 
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
Michele Dionisio & Pietro Lorefice - Developing and testing a device driver w...
 
LAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android NLAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android N
 
Deploy STM32 family on Zephyr - SFO17-102
Deploy STM32 family on Zephyr - SFO17-102Deploy STM32 family on Zephyr - SFO17-102
Deploy STM32 family on Zephyr - SFO17-102
 
ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!
 
LAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel AwarenessLAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel Awareness
 
Kernel Recipes 2016 - Landlock LSM: Unprivileged sandboxing
Kernel Recipes 2016 - Landlock LSM: Unprivileged sandboxingKernel Recipes 2016 - Landlock LSM: Unprivileged sandboxing
Kernel Recipes 2016 - Landlock LSM: Unprivileged sandboxing
 
Libpcap
LibpcapLibpcap
Libpcap
 
LAS16-405:OpenDataPlane: Software Defined Dataplane leader
LAS16-405:OpenDataPlane: Software Defined Dataplane leaderLAS16-405:OpenDataPlane: Software Defined Dataplane leader
LAS16-405:OpenDataPlane: Software Defined Dataplane leader
 

Ähnlich wie Mirko Damiani - An Embedded soft real time distributed system in Go

Keynote: Scaling Sensu Go
Keynote: Scaling Sensu GoKeynote: Scaling Sensu Go
Keynote: Scaling Sensu GoSensu Inc.
 
Netflix Keystone - How Netflix Handles Data Streams up to 11M Events/Sec
Netflix Keystone - How Netflix Handles Data Streams up to 11M Events/SecNetflix Keystone - How Netflix Handles Data Streams up to 11M Events/Sec
Netflix Keystone - How Netflix Handles Data Streams up to 11M Events/SecPeter Bakas
 
MOVED: The challenge of SVE in QEMU - SFO17-103
MOVED: The challenge of SVE in QEMU - SFO17-103MOVED: The challenge of SVE in QEMU - SFO17-103
MOVED: The challenge of SVE in QEMU - SFO17-103Linaro
 
Logs @ OVHcloud
Logs @ OVHcloudLogs @ OVHcloud
Logs @ OVHcloudOVHcloud
 
Migrating to Apache Spark at Netflix
Migrating to Apache Spark at NetflixMigrating to Apache Spark at Netflix
Migrating to Apache Spark at NetflixDatabricks
 
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json  postgre-sql vs. mongodbPGConf APAC 2018 - High performance json  postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json postgre-sql vs. mongodbPGConf APAC
 
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)Kevin Lynch
 
MTCNA Intro to routerOS
MTCNA Intro to routerOSMTCNA Intro to routerOS
MTCNA Intro to routerOSGLC Networks
 
KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...
KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...
KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...Yiran Wang
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network InterfacesKernel TLV
 
Kubernetes from scratch at veepee sysadmins days 2019
Kubernetes from scratch at veepee   sysadmins days 2019Kubernetes from scratch at veepee   sysadmins days 2019
Kubernetes from scratch at veepee sysadmins days 2019🔧 Loïc BLOT
 
ELC 2016 - I2C hacking demystified
ELC 2016 - I2C hacking demystifiedELC 2016 - I2C hacking demystified
ELC 2016 - I2C hacking demystifiedIgor Stoppa
 
High performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbHigh performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbWei Shan Ang
 
Performance challenges in software networking
Performance challenges in software networkingPerformance challenges in software networking
Performance challenges in software networkingStephen Hemminger
 
HBaseCon 2015: OpenTSDB and AsyncHBase Update
HBaseCon 2015: OpenTSDB and AsyncHBase UpdateHBaseCon 2015: OpenTSDB and AsyncHBase Update
HBaseCon 2015: OpenTSDB and AsyncHBase UpdateHBaseCon
 
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation GuideBKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation GuideLinaro
 
Improving Kafka at-least-once performance at Uber
Improving Kafka at-least-once performance at UberImproving Kafka at-least-once performance at Uber
Improving Kafka at-least-once performance at UberYing Zheng
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2aspyker
 
Jvm profiling under the hood
Jvm profiling under the hoodJvm profiling under the hood
Jvm profiling under the hoodRichardWarburton
 

Ähnlich wie Mirko Damiani - An Embedded soft real time distributed system in Go (20)

Kraken mesoscon 2018
Kraken mesoscon 2018Kraken mesoscon 2018
Kraken mesoscon 2018
 
Keynote: Scaling Sensu Go
Keynote: Scaling Sensu GoKeynote: Scaling Sensu Go
Keynote: Scaling Sensu Go
 
Netflix Keystone - How Netflix Handles Data Streams up to 11M Events/Sec
Netflix Keystone - How Netflix Handles Data Streams up to 11M Events/SecNetflix Keystone - How Netflix Handles Data Streams up to 11M Events/Sec
Netflix Keystone - How Netflix Handles Data Streams up to 11M Events/Sec
 
MOVED: The challenge of SVE in QEMU - SFO17-103
MOVED: The challenge of SVE in QEMU - SFO17-103MOVED: The challenge of SVE in QEMU - SFO17-103
MOVED: The challenge of SVE in QEMU - SFO17-103
 
Logs @ OVHcloud
Logs @ OVHcloudLogs @ OVHcloud
Logs @ OVHcloud
 
Migrating to Apache Spark at Netflix
Migrating to Apache Spark at NetflixMigrating to Apache Spark at Netflix
Migrating to Apache Spark at Netflix
 
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json  postgre-sql vs. mongodbPGConf APAC 2018 - High performance json  postgre-sql vs. mongodb
PGConf APAC 2018 - High performance json postgre-sql vs. mongodb
 
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
 
MTCNA Intro to routerOS
MTCNA Intro to routerOSMTCNA Intro to routerOS
MTCNA Intro to routerOS
 
KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...
KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...
KubeCon EU 2019 - P2P Docker Image Distribution in Hybrid Cloud Environment w...
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
 
Kubernetes from scratch at veepee sysadmins days 2019
Kubernetes from scratch at veepee   sysadmins days 2019Kubernetes from scratch at veepee   sysadmins days 2019
Kubernetes from scratch at veepee sysadmins days 2019
 
ELC 2016 - I2C hacking demystified
ELC 2016 - I2C hacking demystifiedELC 2016 - I2C hacking demystified
ELC 2016 - I2C hacking demystified
 
High performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbHigh performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodb
 
Performance challenges in software networking
Performance challenges in software networkingPerformance challenges in software networking
Performance challenges in software networking
 
HBaseCon 2015: OpenTSDB and AsyncHBase Update
HBaseCon 2015: OpenTSDB and AsyncHBase UpdateHBaseCon 2015: OpenTSDB and AsyncHBase Update
HBaseCon 2015: OpenTSDB and AsyncHBase Update
 
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation GuideBKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
 
Improving Kafka at-least-once performance at Uber
Improving Kafka at-least-once performance at UberImproving Kafka at-least-once performance at Uber
Improving Kafka at-least-once performance at Uber
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2
 
Jvm profiling under the hood
Jvm profiling under the hoodJvm profiling under the hood
Jvm profiling under the hood
 

Mehr von linuxlab_conf

Jonathan Corbet - Keynote: The Kernel Report
Jonathan Corbet - Keynote: The Kernel ReportJonathan Corbet - Keynote: The Kernel Report
Jonathan Corbet - Keynote: The Kernel Reportlinuxlab_conf
 
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...linuxlab_conf
 
Bruno Verachten - The Android device farm that fits in a (cloudy) pocket
Bruno Verachten - The Android device farm that fits in a (cloudy) pocketBruno Verachten - The Android device farm that fits in a (cloudy) pocket
Bruno Verachten - The Android device farm that fits in a (cloudy) pocketlinuxlab_conf
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchlinuxlab_conf
 
Jacopo Mondi - Complex cameras are complex
Jacopo Mondi - Complex cameras are complexJacopo Mondi - Complex cameras are complex
Jacopo Mondi - Complex cameras are complexlinuxlab_conf
 
Dario Faggioli - Virtualization in the age of speculative execution HW bugs
Dario Faggioli - Virtualization in the age of speculative execution HW bugsDario Faggioli - Virtualization in the age of speculative execution HW bugs
Dario Faggioli - Virtualization in the age of speculative execution HW bugslinuxlab_conf
 
Tommaso Cucinotta - Low-latency and power-efficient audio applications on Linux
Tommaso Cucinotta - Low-latency and power-efficient audio applications on LinuxTommaso Cucinotta - Low-latency and power-efficient audio applications on Linux
Tommaso Cucinotta - Low-latency and power-efficient audio applications on Linuxlinuxlab_conf
 
Angelo Compagnucci - Upgrading buildroot based devices with swupdate
Angelo Compagnucci - Upgrading buildroot based devices with swupdateAngelo Compagnucci - Upgrading buildroot based devices with swupdate
Angelo Compagnucci - Upgrading buildroot based devices with swupdatelinuxlab_conf
 
Stefano Cordibella - An introduction to Yocto Project
Stefano Cordibella - An introduction to Yocto ProjectStefano Cordibella - An introduction to Yocto Project
Stefano Cordibella - An introduction to Yocto Projectlinuxlab_conf
 
Luca Abeni - Real-Time Virtual Machines with Linux and kvm
Luca Abeni - Real-Time Virtual Machines with Linux and kvmLuca Abeni - Real-Time Virtual Machines with Linux and kvm
Luca Abeni - Real-Time Virtual Machines with Linux and kvmlinuxlab_conf
 
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily JobLuca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Joblinuxlab_conf
 

Mehr von linuxlab_conf (11)

Jonathan Corbet - Keynote: The Kernel Report
Jonathan Corbet - Keynote: The Kernel ReportJonathan Corbet - Keynote: The Kernel Report
Jonathan Corbet - Keynote: The Kernel Report
 
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...
Marco Cavallini - Yocto Project, an automatic generator of embedded Linux dis...
 
Bruno Verachten - The Android device farm that fits in a (cloudy) pocket
Bruno Verachten - The Android device farm that fits in a (cloudy) pocketBruno Verachten - The Android device farm that fits in a (cloudy) pocket
Bruno Verachten - The Android device farm that fits in a (cloudy) pocket
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
 
Jacopo Mondi - Complex cameras are complex
Jacopo Mondi - Complex cameras are complexJacopo Mondi - Complex cameras are complex
Jacopo Mondi - Complex cameras are complex
 
Dario Faggioli - Virtualization in the age of speculative execution HW bugs
Dario Faggioli - Virtualization in the age of speculative execution HW bugsDario Faggioli - Virtualization in the age of speculative execution HW bugs
Dario Faggioli - Virtualization in the age of speculative execution HW bugs
 
Tommaso Cucinotta - Low-latency and power-efficient audio applications on Linux
Tommaso Cucinotta - Low-latency and power-efficient audio applications on LinuxTommaso Cucinotta - Low-latency and power-efficient audio applications on Linux
Tommaso Cucinotta - Low-latency and power-efficient audio applications on Linux
 
Angelo Compagnucci - Upgrading buildroot based devices with swupdate
Angelo Compagnucci - Upgrading buildroot based devices with swupdateAngelo Compagnucci - Upgrading buildroot based devices with swupdate
Angelo Compagnucci - Upgrading buildroot based devices with swupdate
 
Stefano Cordibella - An introduction to Yocto Project
Stefano Cordibella - An introduction to Yocto ProjectStefano Cordibella - An introduction to Yocto Project
Stefano Cordibella - An introduction to Yocto Project
 
Luca Abeni - Real-Time Virtual Machines with Linux and kvm
Luca Abeni - Real-Time Virtual Machines with Linux and kvmLuca Abeni - Real-Time Virtual Machines with Linux and kvm
Luca Abeni - Real-Time Virtual Machines with Linux and kvm
 
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily JobLuca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
Luca Ceresoli - Buildroot vs Yocto: Differences for Your Daily Job
 

Kürzlich hochgeladen

%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 

Kürzlich hochgeladen (20)

%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 

Mirko Damiani - An Embedded soft real time distributed system in Go

  • 1. An Embedded Soft Real Time System in Go Mirko Damiani Software Engineer @ Develer LinuxLab 3-4 Dec 2018
  • 2. Overview ● Soft real time systems ● Our hardware/software solution ● Go advantages for embedded ● Go optimizations
  • 3. Soft Real Time System
  • 4. ● Industrial machines ● Quality features ○ Color ○ Weight ○ Defects ○ Shape ○ ... ● Classification ○ Grouping items together, according to quality features Quality Classifier Photo by Kate Buckley on flickr
  • 5. Industrial Applications Photo by SortingExpert on WikipediaPhoto from prozesstechnik
  • 6. Specs & Outline ● 100 lanes ● 20 items/sec per lane ● 2000 items/sec ● 10 exits per lane ● Industrial scale Photo by Chris Chadd from Pexels Feeder Sensor Exit Lane Rotary Encoder Ejector Classify
  • 7. Need of Precision ● Items are eventually ejected ○ Precise timing of ejection ○ Precision of 250 us ○ Multiple exits ● Usually real time OS are used ○ Higher determinism
  • 9. Our Machine Layout IO IO exit 1 exit 2 ejectorssensors BL data in data out checkpoint ● Boards ○ BL: Business Logic ○ IO: Input/Output ● Business Logic ○ Acquires data from sensors ○ Manages every lane ● Network traffic is heavy ○ Up to 250 sensors ○ Up to 2000 items per second ● Checkpoint ○ Trigger for classification
  • 10. The Challenge Canonical Way ● RTOS kernel ● Custom hardware & boards ● CANBUS communication ● Single board ● Firmware C bare metal
  • 11. The Challenge: Linux and Go Canonical Way ● RTOS kernel ● Custom hardware & boards ● CANBUS communication ● Single board ● Firmware C bare metal Our Solution ● GNU/Linux standard kernel ● Hardware standard components ● Ethernet based communication ● Distributed system ● Go language
  • 12. Why Linux? GNU/Linux ● Real time processes ● Microprocessor boards ● No Safety Certifications ● Plenty of Drivers ● Separation of competences ● Debug on desktop with tools ● Many Languages & Libraries RTOS ● Tasks with priorities ● Microcontrollers (no MMU) ● Safety and Certifications ● Limited number of Drivers ● Single big application ● Debug on hardware boards ● Few Languages and Libraries
  • 13. Network connections ● “BL” Single Business Logic board ○ Freescale i.MX 6, Quad Core ARM Cortex A9 @ 1.2 GHz ○ Performs the items classification for every lane ● “IO” Multiple Input/Output boards ○ Develboard Atmel, Single Core ARM @ 600 MHz ○ Digital inputs and outputs ● Multiple sensor sensors ● Ethernet bus with standard switches/routers BL IO IO IO Ethernet Switch Star topology
  • 14. Different topology with Linux Sw bridge BL IO IO IO BL IO IO IO Star topology Serial topology ● Simplified cabling ● Sw bridge: 15% CPU
  • 15. Latency for Soft Real Time ● Kernel driver with a precision of 250 us ○ DMA + double buffering ○ Buffer has a duration of 100 ms ○ Actual precision of 66 us ● Queue of scheduled activations ○ User space software writes activations to the kernel driver ● Soft real time latency ○ 100 ms + queue management ~= 150 ms ○ System can’t react faster than 150 ms (e.g. change of speed)
  • 16. Rotary encoder ● Lanes are physically bound ○ Multiple encoders in case of big machines ● Encoder steps ○ Square waves ○ 2000 steps/round ● Kernel driver ○ Parameters exported in sysfs A B Z
  • 17. Linear Interpolation ● We cannot synchronize thousands times per second with Ethernet ● Synchronization every 100 ms ● Linear interpolation ○ Encoder accelerations are “slow” because it’s bound to a mechanical transport ● Workaround of a real time protocol t #step ● Real curve ● Interpolated curve
  • 18. BL/IO Clock Synchronization ● Activation messages are marked with a specific timestamp ○ We need to synchronize clocks ● Usually, NTP is used ○ Precision of ~milliseconds => Not enough for us ○ We need a precision of (at least) 250 us ● Precision Time Protocol IEEE 1585 (PTP) ● Two PTP timestamping models: Hardware or Software ○ Software timestamping: Kernel interrupt => Precision of ~microseconds ○ Hardware timestamping: Ethernet interface => Precision of ~nanoseconds ○ Develboard supports IEEE 1858, but software timestamping is enough
  • 20. Basic Advantages ● Simple language, clients got used to it very quickly ● Simple documentation and maintenance ● Static binaries ● Large ecosystem of libraries ● Concurrent programming ● Easy cross compilation ○ Embedded (ARM) ○ Windows ○ Linux
  • 21. Embedded: Go vs C++ ● Stack trace and data race analysis ○ Valgrind slows down performance ● Debug tools ○ Remote debugging and system analysis (gdb vs pprof) ● Linter and code analysis ○ Easier to integrate static analysis tools (e.g. golint, go vet) ● Tags (go build -tags …) ○ Useful for embedded apps and stubs ○ Cleaner approach compared to #ifdef
  • 22. Fine tuning: Disassembly ● go tool objdump -s main.join -S <binary_name> func join(strings []string) string { 0x8bae0 e59a1008 MOVW 0x8(R10), R1 0x8bae4 e15d0001 CMP R1, R13 0x8bae8 9a00001a B.LS 0x8bb58 e 0x8baec e52de024 MOVW.W R14, -0x24(R13) 0x8baf0 e3a00000 MOVW $0, R0 0x8baf4 e3a01000 MOVW $0, R1 0x8baf8 e3a02000 MOVW $0, R2 for _, str := range strings { 0x8bafc ea00000f B 0x8bb40 0x8bb00 e58d0020 MOVW R0, 0x20(R13) 0x8bb04 e59d3028 MOVW 0x28(R13), R3 0x8bb08 e7934180 MOVW (R3)(R0<<3), R4 0x8bb0c e0835180 ADD R0<<$3, R3, R5 0x8bb10 e5955004 MOVW 0x4(R5), R5 package main import ( "fmt" "os" ) func join(strings []string) string { var ret string for _, str := range strings { ret += str } return ret } func main() { fmt.Println(join(os.Args[1:])) }
  • 23. How do we perform tests on Embedded? 1. Unit tests 2. Full integration tests ○ Integration framework ○ Mocking board/instruments as Goroutines ○ Easier than C++ ○ Fast prototyping for tests 3. Continuous integration ○ The real embedded system was simulated on CircleCI
  • 24. ● Monitoring of performance ○ Metrics ○ Profiling ● Google pprof upstream version: ○ go get -u github.com/google/pprof ● Small CPU profile file => 10 minutes execution => just 185 KiB ○ Stand alone, no binary ○ Can read from both local file or over HTTP ○ pprof -http :8081 http://localhost:8080/debug/pprof/profile?seconds=30 Avoid Performance Regression
  • 25. Hardware in the Loop ● Automatic performance monitoring ● We have a real hardware test bench ● We want to deploy our system directly to the test bench ● Results from the test bench are retrieved by CircleCI Repo CI Metrics Hardware
  • 26. Remote Introspection via Browser ● Uncommon in embedded apps ● Expvar ○ Standard interface for public variables ○ Exports figures about the program ○ JSON format // At global scope var requestCount = expvar.NewInt("RequestCount") ... func myHandler(w http.ResponseWriter, r *http.Request) { requestCount.Add(1) ... }
  • 28. Metrics ● Performance analysis ○ We don’t want performance regressions ○ Refactoring ○ Test suites don’t help ● “Tachymeter” library to monitor metrics ○ Low impact, samples are added to a circular buffer ○ Average, Standard Deviation, Percentiles, Min, Max, … ● Multiple outputs ○ Formatted string, JSON string, Histogram text and html ○ HTTP endpoint for remote analysis
  • 29. Checkpoint Margin ● Average ○ Avg 2.301660948s ○ StdDev 176.75148ms ● Percentiles ○ P75 2.222552667s ○ P95 1.921699001s ○ P99 1.721095s ○ P999 1.575430001s ● Limits ○ Max 2.916016667s ○ Min 1.464427001s checkpointsensors margin activation 2 minutes run
  • 30. How is Checkpoint Margin affected? ● I/O bound ● Reading packets from connections ● We need to read fairly from 250 tcp sockets eth/tcpBL S S S
  • 31. Standard Network Loop ● One Goroutine per connection ○ 1. Read data from network ○ 2. Decode packets ○ 3. Send to main loop via channel ● chan packet ○ Sending one packet at time to the main loop ● Can we do better? main loop TCP gorunTCP gorunTCP gorunTCP Read chan packet Concurrent Goroutines
  • 32. Batched Channel ● chan packet vs chan []packet ○ Sending one packet at time is too slow ● Use a single channel write operation to send all packets received from a single TCP read ○ Minimizing channel writes is good main loop TCP gorunTCP gorunTCP gorunTCP Read chan [ ]packet Concurrent Goroutines
  • 33. Number of Channel Writes ● Channel ○ Buffered ○ Slice of packets ● Writes per second ○ 2000 → 25000 w/s ● Total GC STW time ○ 2.28 → 11.50 s Channel Writes per Second [w/s] ● Checkpoint Margin [s] ● GC Time [s] 2 minutes run
  • 34. Failed Test: Using a Mutex ● Goroutines will block on a mutex ○ High contention ○ Go scheduler is cooperative ● Deadline missed ○ Checkpoint event is delayed ● Conn.Read(): Channel Mutex ○ Min 13 us 13 us ○ Max 773 us 1.15 s ○ P99 64 us 510 ms ● Activation margin: Channel Mutex ○ P99 466 ms -1.13 s main loop TCP gorunTCP gorunTCP gorunTCP Read mutex checkpoint margin activation delay
  • 35. Alternative: Using EPOLL ● EPOLL syscall allows to use a single Goroutine ● MultiReader Go interface ○ Reading from multiple connections ○ Monitoring of multiple file descriptors ● Drawbacks ○ It can’t be used on Windows ○ Cannot use net.Socket ○ Maintenance main loop TCP Multi Read type MultiPacketReader interface { // TCP connection with framing Register(conn PacketConn) // Reads from one of the // registered connections ReadPackets(packets [][]byte) (n int, conn PacketConn, err error) } chan [ ]packet
  • 36. CPU Usage: EPOLL VS Go ● 4 CPUs in total ○ Graph shows just one CPU (for simplicity) ● Go impl ○ CPU usage is higher... ○ … but more “uniform” ● EPOLL impl ○ CPU cores are switched more frequently ● EPOLL ● Go Time (2 minutes)
  • 37. Conclusions Thanks mirko@develer.com ● Standard Linux OS and hardware ○ Faster development ○ Distributed system ● Testing and monitoring ○ Fast prototyping for tests ○ Profiling and metrics ○ Performance tests on real hardware ● Optimizations ○ Goroutines management ○ Packets reception ● Drawbacks ○ GC impact must be reduced ○ Mutex contention can be a problem ○ Network APIs are not flexible enough ● Go can be used for embedded apps!