This document provides an overview and introduction to Muduo, a C++ network programming library for Linux. Some key points:
- Muduo is a non-blocking, event-driven, multi-core ready C++ network library that aims to provide high performance and modern features.
- The document discusses challenges with network programming using sockets APIs directly and how a library like Muduo can help abstract away complexity.
- It covers core concepts in non-blocking and event-driven network programming used by Muduo like the event loop, callbacks, and lifetime management of connection objects.
- Examples are provided of how Muduo implements patterns like chat servers and comparisons are made to other libraries
Linux Kernel vs DPDK: HTTP Performance ShowdownScyllaDB
In this session I will use a simple HTTP benchmark to compare the performance of the Linux kernel networking stack with userspace networking powered by DPDK (kernel-bypass).
It is said that kernel-bypass technologies avoid the kernel because it is "slow", but in reality, a lot of the performance advantages that they bring just come from enforcing certain constraints.
As it turns out, many of these constraints can be enforced without bypassing the kernel. If the system is tuned just right, one can achieve performance that approaches kernel-bypass speeds, while still benefiting from the kernel's battle-tested compatibility, and rich ecosystem of tools.
LinuxCon 2015 Linux Kernel Networking WalkthroughThomas Graf
This presentation features a walk through the Linux kernel networking stack for users and developers. It will cover insights into both, existing essential networking features and recent developments and will show how to use them properly. Our starting point is the network card driver as it feeds a packet into the stack. We will follow the packet as it traverses through various subsystems such as packet filtering, routing, protocol stacks, and the socket layer. We will pause here and there to look into concepts such as networking namespaces, segmentation offloading, TCP small queues, and low latency polling and will discuss how to configure them.
Kernel Recipes 2019 - XDP closer integration with network stackAnne Nicolas
XDP (eXpress Data Path) is the new programmable in-kernel fast-path, which is placed as a layer before the existing Linux kernel network stack (netstack).
We claim XDP is not kernel-bypass, as it is a layer before and it can easily fall-through to netstack. Reality is that it can easily be (ab)used to create a kernel-bypass situation, where non of the kernel facilities are used (in form of BPF-helpers and in-kernel tables). The main disadvantage with kernel-bypass, is the need to re-implement everything, even basic building blocks, like routing tables and ARP protocol handling.
It is part of the concept and speed gain, that XDP allows users to avoid calling part of the kernel code. Users have the freedom to do kernel-bypass and re-implement everything, but the kernel should provide access to more in-kernel tables, via BPF-helpers, such that users can leverage other parts of the Open Source ecosystem, like router daemons etc.
This talk is about how XDP can work in-concert with netstack, and proposal on how we can take this even-further. Crazy ideas like using XDP frames to move SKB allocation out of driver code, will also be proposed.
[DockerCon 2020] Hardening Docker daemon with Rootless ModeAkihiro Suda
"Docker supports ""Rootless mode"", which allows running the entire Docker daemon and its dependencies as a non-root user on the host, so as to protect the host from malicious containers in a simple but very strong way. Rootless mode is also attractive for users who cannot get `sudo` permission for installing Docker on shared computing machines. e.g. HPC users. In this talk, Akihiro Suda, the author of the Rootless mode, will explain how users can get started with Rootless mode. He will also explain the recent updates including support for Cgroup V2 and FUSE-OverlayFS."
https://docker.events.cube365.net/docker/dockercon/content/Videos/wHjxizoWgFgCYu6aF
Linux Kernel vs DPDK: HTTP Performance ShowdownScyllaDB
In this session I will use a simple HTTP benchmark to compare the performance of the Linux kernel networking stack with userspace networking powered by DPDK (kernel-bypass).
It is said that kernel-bypass technologies avoid the kernel because it is "slow", but in reality, a lot of the performance advantages that they bring just come from enforcing certain constraints.
As it turns out, many of these constraints can be enforced without bypassing the kernel. If the system is tuned just right, one can achieve performance that approaches kernel-bypass speeds, while still benefiting from the kernel's battle-tested compatibility, and rich ecosystem of tools.
LinuxCon 2015 Linux Kernel Networking WalkthroughThomas Graf
This presentation features a walk through the Linux kernel networking stack for users and developers. It will cover insights into both, existing essential networking features and recent developments and will show how to use them properly. Our starting point is the network card driver as it feeds a packet into the stack. We will follow the packet as it traverses through various subsystems such as packet filtering, routing, protocol stacks, and the socket layer. We will pause here and there to look into concepts such as networking namespaces, segmentation offloading, TCP small queues, and low latency polling and will discuss how to configure them.
Kernel Recipes 2019 - XDP closer integration with network stackAnne Nicolas
XDP (eXpress Data Path) is the new programmable in-kernel fast-path, which is placed as a layer before the existing Linux kernel network stack (netstack).
We claim XDP is not kernel-bypass, as it is a layer before and it can easily fall-through to netstack. Reality is that it can easily be (ab)used to create a kernel-bypass situation, where non of the kernel facilities are used (in form of BPF-helpers and in-kernel tables). The main disadvantage with kernel-bypass, is the need to re-implement everything, even basic building blocks, like routing tables and ARP protocol handling.
It is part of the concept and speed gain, that XDP allows users to avoid calling part of the kernel code. Users have the freedom to do kernel-bypass and re-implement everything, but the kernel should provide access to more in-kernel tables, via BPF-helpers, such that users can leverage other parts of the Open Source ecosystem, like router daemons etc.
This talk is about how XDP can work in-concert with netstack, and proposal on how we can take this even-further. Crazy ideas like using XDP frames to move SKB allocation out of driver code, will also be proposed.
[DockerCon 2020] Hardening Docker daemon with Rootless ModeAkihiro Suda
"Docker supports ""Rootless mode"", which allows running the entire Docker daemon and its dependencies as a non-root user on the host, so as to protect the host from malicious containers in a simple but very strong way. Rootless mode is also attractive for users who cannot get `sudo` permission for installing Docker on shared computing machines. e.g. HPC users. In this talk, Akihiro Suda, the author of the Rootless mode, will explain how users can get started with Rootless mode. He will also explain the recent updates including support for Cgroup V2 and FUSE-OverlayFS."
https://docker.events.cube365.net/docker/dockercon/content/Videos/wHjxizoWgFgCYu6aF
IVOZ Provider Open Source - La solución VoIP opensource para operadores e int...Irontec
IVOZ es una solución de telefonía IP modular que está basada en un núcleo de comunicaciones Asterisk y se rodea de todos los componentes extra que requieren entornos críticos o de alto rendimiento.
IVOZ Provider es una solución de telefonía IP para operadores, multimarca y multitenant y expuesta a la red pública. Con IVOZ provider opensource queremos llegar a todo tipo de clientes que quieran desplegar sus sistemas de telefonía IP con una solución opensource de calidad, que ha sido testada en grandes proyectos y es capaz de dar servicios a cientos de
miles de llamadas de forma concurrente.
As a part of kotlinx.coroutines 1.2 Flow was introduced as a cold asynchronous data stream. How does it work? What we can do with it? Is it that we waiting so long for replacing Rx? The talk has answers to them.
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
The microservices honeymoon is over. When starting a new project or revamping a legacy monolith, teams started looking for alternatives to microservices. The Modular Monolith, or 'Modulith', is an architecture that reaps the benefits of (vertical) functional decoupling without the high costs associated with separate deployments. This talk will delve into the advantages and challenges of this progressive architecture, beginning with exploring the concept of a 'module', its internal structure, public API, and inter-module communication patterns. Supported by spring-modulith, the talk provides practical guidance on addressing the main challenges of a Modultith Architecture: finding and guarding module boundaries, data decoupling, and integration module-testing. You should not miss this talk if you are a software architect or tech lead seeking practical, scalable solutions.
About the author
With two decades of experience, Victor is a Java Champion working as a trainer for top companies in Europe. Five thousands developers in 120 companies attended his workshops, so he gets to debate every week the challenges that various projects struggle with. In return, Victor summarizes key points from these workshops in conference talks and online meetups for the European Software Crafters, the world’s largest developer community around architecture, refactoring, and testing. Discover how Victor can help you on victorrentea.ro : company training catalog, consultancy and YouTube playlists.
A Kernel of Truth: Intrusion Detection and Attestation with eBPFoholiab
"Attestation is hard" is something you might hear from security researchers tracking nation states and APTs, but it's actually pretty true for most network-connected systems!
Modern deployment methodologies mean that disparate teams create workloads for shared worker-hosts (ranging from Jenkins to Kubernetes and all the other orchestrators and CI tools in-between), meaning that at any given moment your hosts could be running any one of a number of services, connecting to who-knows-what on the internet.
So when your network-based intrusion detection system (IDS) opaquely declares that one of these machines has made an "anomalous" network connection, how do you even determine if it's business as usual? Sure you can log on to the host to try and figure it out, but (in case you hadn't noticed) computers are pretty fast these days, and once the connection is closed it might as well not have happened... Assuming it wasn't actually a reverse shell...
At Yelp we turned to the Linux kernel to tell us whodunit! Utilizing the Linux kernel's eBPF subsystem - an in-kernel VM with syscall hooking capabilities - we're able to aggregate metadata about the calling process tree for any internet-bound TCP connection by filtering IPs and ports in-kernel and enriching with process tree information in userland. The result is "pidtree-bcc": a supplementary IDS. Now whenever there's an alert for a suspicious connection, we just search for it in our SIEM (spoiler alert: it's nearly always an engineer doing something "innovative")! And the cherry on top? It's stupid fast with negligible overhead, creating a much higher signal-to-noise ratio than the kernels firehose-like audit subsystems.
This talk will look at how you can tune the signal-to-noise ratio of your IDS by making it reflect your business logic and common usage patterns, get more work done by reducing MTTR for false positives, use eBPF and the kernel to do all the hard work for you, accidentally load test your new IDS by not filtering all RFC-1918 addresses, and abuse Docker to get to production ASAP!
As well as looking at some of the technologies that the kernel puts at your disposal, this talk will also tell pidtree-bcc's road from hackathon project to production system and how focus on demonstrating business value early on allowed the organization to give us buy-in to build and deploy a brand new project from scratch.
This is the slide deck I presented at the first CommCon event in the UK: it goes through some of the possible strategies for scaling WebRTC applications, mostly if you're using Janus but not only.
Video: https://www.youtube.com/watch?v=JRFNIKUROPE . Talk for linux.conf.au 2017 (LCA2017) by Brendan Gregg, about Linux enhanced BPF (eBPF). Abstract:
A world of new capabilities is emerging for the Linux 4.x series, thanks to enhancements that have been included in Linux for to Berkeley Packet Filter (BPF): an in-kernel virtual machine that can execute user space-defined programs. It is finding uses for security auditing and enforcement, enhancing networking (including eXpress Data Path), and performance observability and troubleshooting. Many new open source tools that have been written in the past 12 months for performance analysis that use BPF. Tracing superpowers have finally arrived for Linux!
For its use with tracing, BPF provides the programmable capabilities to the existing tracing frameworks: kprobes, uprobes, and tracepoints. In particular, BPF allows timestamps to be recorded and compared from custom events, allowing latency to be studied in many new places: kernel and application internals. It also allows data to be efficiently summarized in-kernel, including as histograms. This has allowed dozens of new observability tools to be developed so far, including measuring latency distributions for file system I/O and run queue latency, printing details of storage device I/O and TCP retransmits, investigating blocked stack traces and memory leaks, and a whole lot more.
This talk will summarize BPF capabilities and use cases so far, and then focus on its use to enhance Linux tracing, especially with the open source bcc collection. bcc includes BPF versions of old classics, and many new tools, including execsnoop, opensnoop, funcccount, ext4slower, and more (many of which I developed). Perhaps you'd like to develop new tools, or use the existing tools to find performance wins large and small, especially when instrumenting areas that previously had zero visibility. I'll also summarize how we intend to use these new capabilities to enhance systems analysis at Netflix.
The Docker network overlay driver relies on several technologies: network namespaces, VXLAN, Netlink and a distributed key-value store. This talk will present each of these mechanisms one by one along with their userland tools and show hands-on how they interact together when setting up an overlay to connect containers. The talk will continue with a demo showing how to build your own simple overlay using these technologies. Finally, it will show how we can dynamically distribute IP and MAC information to every hosts in the overlay using BGP EVPN
All Your IOPS Are Belong To Us - A Pinteresting Case Study in MySQL Performan...Ernie Souhrada
Have you ever thought that your SSD storage just doesn't seem anywhere near as fast as advertised? What if I told you that a couple of small changes to your Linux servers had the potential to more than double the amount of throughput your MySQL servers could handle while simultaneously reducing query response time by around 50 percent? It's not a dream, Neo.
If you're still in a traditional data center and/or your MySQL footprint lives on spinning rust, then you might want to take the blue pill, attend a different session, and believe whatever you want to believe.
However, if your server footprint runs inside Amazon Web Services or if you use SSDs in any fashion, I invite you to take the red pill and come with me on a journey down the rabbit hole, where we'll discuss such things as the Linux block IO driver, CPU starvation, and interrupt handling, using real-world query performance data from the primary MySQL data stores at Pinterest to illustrate the effect.
Building Network Functions with eBPF & BCCKernel TLV
eBPF (Extended Berkeley Packet Filter) is an in-kernel virtual machine that allows running user-supplied sandboxed programs inside of the kernel. It is especially well-suited to network programs and it's possible to write programs that filter traffic, classify traffic and perform high-performance custom packet processing.
BCC (BPF Compiler Collection) is a toolkit for creating efficient kernel tracing and manipulation programs. It makes use of eBPF.
BCC provides an end-to-end workflow for developing eBPF programs and supplies Python bindings, making eBPF programs much easier to write.
Together, eBPF and BCC allow you to develop and deploy network functions safely and easily, focusing on your application logic (instead of kernel datapath integration).
In this session, we will introduce eBPF and BCC, explain how to implement a network function using BCC, discuss some real-life use-cases and show a live demonstration of the technology.
About the speaker
Shmulik Ladkani, Chief Technology Officer at Meta Networks,
Long time network veteran and kernel geek.
Shmulik started his career at Jungo (acquired by NDS/Cisco) implementing residential gateway software, focusing on embedded Linux, Linux kernel, networking and hardware/software integration.
Some billions of forwarded packets later, Shmulik left his position as Jungo's lead architect and joined Ravello Systems (acquired by Oracle) as tech lead, developing a virtual data center as a cloud-based service, focusing around virtualization systems, network virtualization and SDN.
Recently he co-founded Meta Networks where he's been busy architecting secure, multi-tenant, large-scale network infrastructure as a cloud-based service.
IVOZ Provider Open Source - La solución VoIP opensource para operadores e int...Irontec
IVOZ es una solución de telefonía IP modular que está basada en un núcleo de comunicaciones Asterisk y se rodea de todos los componentes extra que requieren entornos críticos o de alto rendimiento.
IVOZ Provider es una solución de telefonía IP para operadores, multimarca y multitenant y expuesta a la red pública. Con IVOZ provider opensource queremos llegar a todo tipo de clientes que quieran desplegar sus sistemas de telefonía IP con una solución opensource de calidad, que ha sido testada en grandes proyectos y es capaz de dar servicios a cientos de
miles de llamadas de forma concurrente.
As a part of kotlinx.coroutines 1.2 Flow was introduced as a cold asynchronous data stream. How does it work? What we can do with it? Is it that we waiting so long for replacing Rx? The talk has answers to them.
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
The microservices honeymoon is over. When starting a new project or revamping a legacy monolith, teams started looking for alternatives to microservices. The Modular Monolith, or 'Modulith', is an architecture that reaps the benefits of (vertical) functional decoupling without the high costs associated with separate deployments. This talk will delve into the advantages and challenges of this progressive architecture, beginning with exploring the concept of a 'module', its internal structure, public API, and inter-module communication patterns. Supported by spring-modulith, the talk provides practical guidance on addressing the main challenges of a Modultith Architecture: finding and guarding module boundaries, data decoupling, and integration module-testing. You should not miss this talk if you are a software architect or tech lead seeking practical, scalable solutions.
About the author
With two decades of experience, Victor is a Java Champion working as a trainer for top companies in Europe. Five thousands developers in 120 companies attended his workshops, so he gets to debate every week the challenges that various projects struggle with. In return, Victor summarizes key points from these workshops in conference talks and online meetups for the European Software Crafters, the world’s largest developer community around architecture, refactoring, and testing. Discover how Victor can help you on victorrentea.ro : company training catalog, consultancy and YouTube playlists.
A Kernel of Truth: Intrusion Detection and Attestation with eBPFoholiab
"Attestation is hard" is something you might hear from security researchers tracking nation states and APTs, but it's actually pretty true for most network-connected systems!
Modern deployment methodologies mean that disparate teams create workloads for shared worker-hosts (ranging from Jenkins to Kubernetes and all the other orchestrators and CI tools in-between), meaning that at any given moment your hosts could be running any one of a number of services, connecting to who-knows-what on the internet.
So when your network-based intrusion detection system (IDS) opaquely declares that one of these machines has made an "anomalous" network connection, how do you even determine if it's business as usual? Sure you can log on to the host to try and figure it out, but (in case you hadn't noticed) computers are pretty fast these days, and once the connection is closed it might as well not have happened... Assuming it wasn't actually a reverse shell...
At Yelp we turned to the Linux kernel to tell us whodunit! Utilizing the Linux kernel's eBPF subsystem - an in-kernel VM with syscall hooking capabilities - we're able to aggregate metadata about the calling process tree for any internet-bound TCP connection by filtering IPs and ports in-kernel and enriching with process tree information in userland. The result is "pidtree-bcc": a supplementary IDS. Now whenever there's an alert for a suspicious connection, we just search for it in our SIEM (spoiler alert: it's nearly always an engineer doing something "innovative")! And the cherry on top? It's stupid fast with negligible overhead, creating a much higher signal-to-noise ratio than the kernels firehose-like audit subsystems.
This talk will look at how you can tune the signal-to-noise ratio of your IDS by making it reflect your business logic and common usage patterns, get more work done by reducing MTTR for false positives, use eBPF and the kernel to do all the hard work for you, accidentally load test your new IDS by not filtering all RFC-1918 addresses, and abuse Docker to get to production ASAP!
As well as looking at some of the technologies that the kernel puts at your disposal, this talk will also tell pidtree-bcc's road from hackathon project to production system and how focus on demonstrating business value early on allowed the organization to give us buy-in to build and deploy a brand new project from scratch.
This is the slide deck I presented at the first CommCon event in the UK: it goes through some of the possible strategies for scaling WebRTC applications, mostly if you're using Janus but not only.
Video: https://www.youtube.com/watch?v=JRFNIKUROPE . Talk for linux.conf.au 2017 (LCA2017) by Brendan Gregg, about Linux enhanced BPF (eBPF). Abstract:
A world of new capabilities is emerging for the Linux 4.x series, thanks to enhancements that have been included in Linux for to Berkeley Packet Filter (BPF): an in-kernel virtual machine that can execute user space-defined programs. It is finding uses for security auditing and enforcement, enhancing networking (including eXpress Data Path), and performance observability and troubleshooting. Many new open source tools that have been written in the past 12 months for performance analysis that use BPF. Tracing superpowers have finally arrived for Linux!
For its use with tracing, BPF provides the programmable capabilities to the existing tracing frameworks: kprobes, uprobes, and tracepoints. In particular, BPF allows timestamps to be recorded and compared from custom events, allowing latency to be studied in many new places: kernel and application internals. It also allows data to be efficiently summarized in-kernel, including as histograms. This has allowed dozens of new observability tools to be developed so far, including measuring latency distributions for file system I/O and run queue latency, printing details of storage device I/O and TCP retransmits, investigating blocked stack traces and memory leaks, and a whole lot more.
This talk will summarize BPF capabilities and use cases so far, and then focus on its use to enhance Linux tracing, especially with the open source bcc collection. bcc includes BPF versions of old classics, and many new tools, including execsnoop, opensnoop, funcccount, ext4slower, and more (many of which I developed). Perhaps you'd like to develop new tools, or use the existing tools to find performance wins large and small, especially when instrumenting areas that previously had zero visibility. I'll also summarize how we intend to use these new capabilities to enhance systems analysis at Netflix.
The Docker network overlay driver relies on several technologies: network namespaces, VXLAN, Netlink and a distributed key-value store. This talk will present each of these mechanisms one by one along with their userland tools and show hands-on how they interact together when setting up an overlay to connect containers. The talk will continue with a demo showing how to build your own simple overlay using these technologies. Finally, it will show how we can dynamically distribute IP and MAC information to every hosts in the overlay using BGP EVPN
All Your IOPS Are Belong To Us - A Pinteresting Case Study in MySQL Performan...Ernie Souhrada
Have you ever thought that your SSD storage just doesn't seem anywhere near as fast as advertised? What if I told you that a couple of small changes to your Linux servers had the potential to more than double the amount of throughput your MySQL servers could handle while simultaneously reducing query response time by around 50 percent? It's not a dream, Neo.
If you're still in a traditional data center and/or your MySQL footprint lives on spinning rust, then you might want to take the blue pill, attend a different session, and believe whatever you want to believe.
However, if your server footprint runs inside Amazon Web Services or if you use SSDs in any fashion, I invite you to take the red pill and come with me on a journey down the rabbit hole, where we'll discuss such things as the Linux block IO driver, CPU starvation, and interrupt handling, using real-world query performance data from the primary MySQL data stores at Pinterest to illustrate the effect.
Building Network Functions with eBPF & BCCKernel TLV
eBPF (Extended Berkeley Packet Filter) is an in-kernel virtual machine that allows running user-supplied sandboxed programs inside of the kernel. It is especially well-suited to network programs and it's possible to write programs that filter traffic, classify traffic and perform high-performance custom packet processing.
BCC (BPF Compiler Collection) is a toolkit for creating efficient kernel tracing and manipulation programs. It makes use of eBPF.
BCC provides an end-to-end workflow for developing eBPF programs and supplies Python bindings, making eBPF programs much easier to write.
Together, eBPF and BCC allow you to develop and deploy network functions safely and easily, focusing on your application logic (instead of kernel datapath integration).
In this session, we will introduce eBPF and BCC, explain how to implement a network function using BCC, discuss some real-life use-cases and show a live demonstration of the technology.
About the speaker
Shmulik Ladkani, Chief Technology Officer at Meta Networks,
Long time network veteran and kernel geek.
Shmulik started his career at Jungo (acquired by NDS/Cisco) implementing residential gateway software, focusing on embedded Linux, Linux kernel, networking and hardware/software integration.
Some billions of forwarded packets later, Shmulik left his position as Jungo's lead architect and joined Ravello Systems (acquired by Oracle) as tech lead, developing a virtual data center as a cloud-based service, focusing around virtualization systems, network virtualization and SDN.
Recently he co-founded Meta Networks where he's been busy architecting secure, multi-tenant, large-scale network infrastructure as a cloud-based service.
When you are about to delete an object, how do you know that it is not being used in another thread?
How can you tell if the object is still alive before you trying call its member function? Is it being destructed in another thread?
Has the traditional intro to event looped servers (thanks Ryan!) with a couple of examples of why I think node.js is particularly exciting today. Code for the demos can be found at https://github.com/davidpadbury/node-intro.
Original slides from Ryan Dahl's NodeJs intro talkAarti Parikh
These are the original slides from the nodejs talk. I was surprised not find them on slideshare so adding them. The video link is here https://www.youtube.com/watch?v=ztspvPYybIY
These are the slides to a talk I gave at Pittsburgh techFest 2012. The topic was an overview of the Node.js framework, and how you can use it to build amazing things.
* See more of my work at http://www.codehenge.net
Netty @Apple: Large Scale Deployment/ConnectivityC4Media
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/1SIYyxQ.
Norman Maurer presents how Apple uses Netty for its Java based services and the challenges of doing so, including how they enhanced performance by participating in the Netty open source community. Maurer takes a deep dive into advanced topics like JNI, JVM internals, and others. Filmed at qconsf.com.
Norman Maurer is one of the core developers of Netty, a member of the Apache Software Foundation and a contributor to many Open Source Projects. He's a Senior Software Engineer for Apple, where he works on Netty and other projects.
So you want to auto scale your services, and use service oriented architecture, eh?
Want to reduce the cost of managing your clusters, and discover them dynamically?
In this talk we shall see how consul helps you do that very efficiently, demonstrate spinning up several interconnected services, and show how we can achieve seamless discovery, HA, and fault tolerance.
One-Man Ops with Puppet & Friends.
If you're getting started in Amazon AWS here's 7 tools that will help you be successful, a few tips to make your life easier and some common pitfalls to avoid.
Dave Orchard - Offline Web Apps with HTML5Web Directions
There’s an old expression, that there are only 2 hard problems in computing: naming, cache invalidation and off-by-one errors. Building offline web apps is all about those hard problems. There are some different ways of storing stuff — such as html5 caching, html5 storage, sqllite, and even native stores such as contacts and calendars — and we’ll sing their praises. But the really hard problems are knowing what to store, whether the stuff is still good or needs refreshing, how much to store, how to resolve conflicts between the client and server, how to integrate with data-specific stores, all in a bewildering cacophony of network and storage limited devices. We’ll spend the bulk of our time on these hard problems, which is probably more useful than api description and sample code.
Dave Orchard is Mobile Architect at Salesforce.com and located in Vancouver, Canada. This means being involved in many mobile platforms, architectures, tools, technologies and APIs. Prior to that, he was a co-founder of Ayogo Games and focused on iPhone and ruby/merb/mysql based casual social games. Back further in the mists of time, he was the Web standards lead for BEA Systems for 7 years, including being elected three times to 2 year terms on the W3C Technical Architecture Group chaired by Sir Tim Berners-Lee.
Follow Dave on Twitter: @DaveO
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
2. What is Muduo?
2
non-blocking,
event-driven,
multi-core ready,
modern (NYF’s*)
C++ network library
for Linux
Buzz words!!!
BSD License of course
2012/06 * Not your father’s www.chenshuo.com
3. Learn network programming
3
in an afternoon? Let’s build greeting server/client
import socket, time import socket, os
serversocket = socket.socket( sock = socket.socket(
socket.AF_INET, socket.AF_INET,
socket.SOCK_STREAM) socket.SOCK_STREAM)
# set SO_REUSEADDR sock.connect((host, 8888))
serversocket.bind(('', 8888)) sock.send(os.getlogin() + 'n')
serversocket.listen(5) message = sock.recv(4096)
print message
while True: sock.close()
(clientsocket, address) = serversocket.accept()
name = clientsocket.recv(4096)
datetime = time.asctime()
clientsocket.send('Hello ' + name)
clientsocket.send('My time is ' + datetime + 'n') ~10 Sockets APIs
clientsocket.close() Simple, huh ?
2012/06 www.chenshuo.com
4. Sockets API might be harder than
4
you thought
Run on local host Run on network
$ ./hello-client.py localhost $ ./hello-client.py atom
Hello schen Hello schen
My time is Sun May 13 12:56:44 2012
Incomplete response!!! Why ?
Standard libraries (C/Java/Python) do not
provide higher abstractions than Sockets API
Naive implementation is most-likely wrong
Sometimes hurt you after being deployed to prod env
That’s why we need good network library
2012/06 www.chenshuo.com
5. Performance goals
5
High performance? Hard to define
Satisfactory (adequate) Performance
Not to be a/the bottleneck of the system
Saturate GbE bandwidth
Even Python can do this
50k concurrent connections
No special efforts needed on modern hardware
n0k+ messages per second
Distribute msg to 30k clients in 0.99s (EC2 small)
2012/06 40k clients in 0.75s (Atom D525 1.8GHz dualwww.chenshuo.com
core HT)
6. Caution: Unfair
Comparison
Nginx w/ echo module, not even static file
http://weibo.com/1701018393/y8jw8AdUQ
6 2012/06 www.chenshuo.com
7. Muduo vs. Boost Asio
7
http://www.cnblogs.com/Solstice/archive/2010/09/04/muduo_vs_asio.html
Loopback device, because even Python can saturate 1GbE
2012/06 www.chenshuo.com
8. Muduo vs. libevent 2.0.x
8
http://www.cnblogs.com/Solstice/archive/2010/09/05/muduo_vs_libevent.html
Loopback device * Libevent 2.1.x should be better
2012/06 www.chenshuo.com
11. Some performance metrics
11
Use their own benchmarks
Nginx 100k qps for in-memory reqs
Asio higher throughput, 800MiB+/s
Libevent ditto, same event handling speed
pub sub deliver msg to 40k clients in 1 sec
RPC 100k qps @ 100c,
260k~515k with batching/pipelining
At least proves “No obvious mistake made on
critical path of Muduo”
2012/06 www.chenshuo.com
12. Where does Muduo fit in the stack?
12
General-purpose (neutral carrier) network library
Let you focus on business logic
Wraps sockets API, take care of IO complexity
3.5 essential events (conn up/down, read, write complete)
Libraries that share similar features/purposes
C – libevent, C++ – ACE/ASIO, Java – Netty, Mina
Python – twisted, Perl – POE, Ruby – EventMachine
Not comparable to ‘frameworks’
ICE a RPC framework, see muduo-protorpc
Tomcat, Node.js built only/mainly for HTTP
ZeroMQ
2012/06 4 messaging patternswww.chenshuo.com
13. Two major approaches to deal with
13
many concurrent connections
When ‘thread’ is cheap, 10k+ ‘thread’s in program
Createone or two threads per connection, blocking IO
Python gevent, Go goroutine/channel, Erlang actor
When thread is expensive, a handful of threads
Eachthread serves many connections
Non-blocking IO with IO multiplexing (select/epoll)
IO multiplexing is actually thread-reusing
Event
notification using callbacks
Muduo, Netty, Python twisted, Node.js, libevent, etc.
Not all libraries can make good use of multi-cores.
But Muduo can
2012/06 www.chenshuo.com
14. Blocking IO is not always bad
14
A socks proxy, TCP relay, port forwarding
client <-> proxy <-> server
def forward(source, destination):
while True:
data = source.recv(4096)
if data:
destination.sendall(data)
else:
destination.shutdown(socket.SHUT_WR)
break
thread.start_new_thread(forward, (clientsocket, sock))
thread.start_new_thread(forward, (sock, clientsocket))
OK to use blocking IO when interaction is simple
Bandwidth/throttling is done by kernel
2012/06 www.chenshuo.com
15. Non-blocking IO
15
Imagine writing a chat server with blocking IO
Message from one connection needs to be sent to
many connections
Connections are up and down all the time
How to keep the integrity of a message being forwarded
How many threads do you need for N connections ?
Try non-blocking IO instead
Essential of event-driven network programming in
30 lines of code
Take a breath
2012/06 www.chenshuo.com
16. # set up serversocket, socket()/bind()/listen(), as before
poll = select.poll() # epoll() should work the same
poll.register(serversocket.fileno(), select.POLLIN)
connections = {}
while True: # The event loop Demo only, not good quality
events = poll.poll(10000) IO multiplexing only
for fileno, event in events:
if fileno == serversocket.fileno():
(clientsocket, address) = serversocket.accept()
# clientsocket.setblocking(0) ??
poll.register(clientsocket.fileno(), select.POLLIN)
connections[clientsocket.fileno()] = clientsocket
elif event & select.POLLIN:
clientsocket = connections[fileno]
data = clientsocket.recv(4096) # incomplete msg ?
if data:
Business
for (fd, othersocket) in connections.iteritems():
logic
if othersocket != clientsocket:
othersocket.send(data) # partial sent ??
else: chat server
poll.unregister(fileno)
clientsocket.close()
16 2012/06 del connections[fileno] www.chenshuo.com
17. # set up serversocket, socket()/bind()/listen(), as before
poll = select.poll() # epoll() should work the same
poll.register(serversocket.fileno(), select.POLLIN)
connections = {}
while True: # The event loop Demo only, not good quality
events = poll.poll(10000) IO multiplexing only
for fileno, event in events:
if fileno == serversocket.fileno():
(clientsocket, address) = serversocket.accept()
# clientsocket.setblocking(0) ??
poll.register(clientsocket.fileno(), select.POLLIN)
connections[clientsocket.fileno()] = clientsocket
elif event & select.POLLIN:
clientsocket = connections[fileno]
data = clientsocket.recv(4096)
if data:
Business
clientsocket.send(data) # partial sent ??
logic
else: echo server
poll.unregister(fileno)
clientsocket.close() Most code are identical
17 2012/06 del connections[fileno] www.chenshuo.com
Make them a library
18. Pitfalls of non-blocking IO
18
Partial write, how to deal with remaining data?
You must use an output buffer per socket for next try,
but when to watch POLLOUT event?
Incomplete read, what if data arrives byte-by-byte
TCP is a byte stream, use an input buffer to decode
Alternatively, use a state machine, which is more complex
Connection management, Socket lifetime mgmt
File descriptors are small integers, prone to cross talk
Muduo is aware of and well prepared for all above!
Focus on your business logic and let Muduo do the rest
2012/06 www.chenshuo.com
19. Event loop (reactor), the heart of
19
non-blocking network programming
Dispatches IO event to callback functions
Events: socket is readable, writable, error, hang up
Message loop in Win32 programming
While (GetMessage(&msg, NULL, 0, 0) > 0) // epoll_wait()
{
TranslateMessage(&msg);
DispatchMessage(&msg); // here’s the beef
}
Cooperative multitasking, blocking is unacceptable
Muduo unifies event loop wakeup, timer queue,
signal handler all with file read/write
Also make it non-portable
2012/06 www.chenshuo.com
20. 20 2012/06
IO responses are instant, one CPU used
www.chenshuo.com
Events happen in sequence
21. One event loop with thread pool
21
2012/06
Computational task is heavy, IO is light
www.chenshuo.com
22. Any library function that accesses
22
file or network can be blocking
The whole C/Posix library is blocking/synchronous
Disk IO is blocking, use threads to make it cooperating
‘harmless’ functions could block current thread
gethostbyname() could read /etc/hosts or query DNS
getpwuid() could read /etc/passwd or query NIS*
localtime()/ctime() could read /etc/localtime
Files could be on network mapped file system!
What if this happens in a busy network IO thread?
Server is responseless for seconds, may cause trashing
2012/06 * /var/db/passwd.db or LDAP www.chenshuo.com
23. Non-blocking is a paradigm shift
23
Have to pay the cost if you want to write high
performance network application in traditional
languages like C/C++/Java
It’s a mature technique for nearly 20 years
Drivers/Adaptors needed for all operations
Non-blocking DNSresolving, UDNS or c-ares
Non-blocking HTTP client/server, curl and microhttpd
Examples provided in muduo and muduo-udns
Non-blocking database query, libpq or libdrizzle
Need drivers to make them work in muduo
Non-blocking logging, in muduo 0.5.0
2012/06 www.chenshuo.com
24. Event loop in multi-core era
24
One loop per thread is usually a good model
Before you try any other fancy ‘pattern’
Muduo supports both single/multi-thread usage
Justassign TcpConnection to any EventLoop, all IO
happens in that EventLoop thread
The thread is predictable, EventLoop::runInLoop()
Many other ‘event-driven’ libraries can’t make
use of multi-cores, you have to run multiple
processes
2012/06 www.chenshuo.com
25. One event loop per thread
25
2012/06 Prioritize connections with threads www.chenshuo.com
27. Object lifetime management
27
Muduo classes are concrete & non-copyable
And have no base class or virtual destructor
EventLoop, TcpServer, TcpClient are all long-live
objects. Their ownership is clean, not shared.
TcpConnection is vague
TcpServer may hold all alive connection objects
You may also hold some/all of them for sending data
It’s the only class managed by std::shared_ptr
No ‘delete this’, it’s a joke
muduo will not pass raw pointer to/from www.chenshuo.com
2012/06 client code
28. class EchoServer { // non-copyable
public:
EchoServer(EventLoop* loop, const InetAddress& listenAddr)
: server_(loop, listenAddr, "EchoServer") {
server_.setConnectionCallback(
boost::bind(&EchoServer::onConnection, this, _1));
server_.setMessageCallback(
boost::bind(&EchoServer::onMessage, this, _1, _2, _3));
server_.setThreadNum(numThreads);
}
private:
void onConnection(const TcpConnectionPtr& conn) {
// print, you may keep a copy of conn for further usage
}
void onMessage(const TcpConnectionPtr& conn,
Buffer* buf, Timestamp time) {
string data(buf->retrieveAsString());
conn->send(data);
} But echo is too simple to be meaningful
TcpServer server_; // a member, not base class. More is possible
28
}; 2012/06 www.chenshuo.com
35. Design goals of Muduo
35
Intranet, not Internet.
Distributed system in a global company
Use HTTP on internet, it’s the universal protocol
Build network application with business logic,
not writing well-known network server
Not for building high-performance httpd, ntpd, ftpd,
webproxy, bind
Components in distributed system
master/chunk-server in GFS
TCP long connections
Muduo thread model is not optimized for short TCP
connections, as accept(2) and IO in two loops
2012/06 www.chenshuo.com
37. Muduo doesn’t
37
Support transport protocols other than TCPv4
IPv6,UDP, Serial port, SNMP, ARP, RARP
Build your own with muduo::Channel class
Any thing that is ‘selectable’ can integrated into Muduo
May support SSL in future, but with low priority
Use https for internet service, use VPN for info security
Support platforms other than Linux 2.6/3.x
Never port to Windows
Unlikely port to FreeBSD, Solaris
However, it runs on ARM9 boards, with Linux 2.6.32
2012/06 www.chenshuo.com
38. List of muduo libraries
38
Muduo The core library
baselibrary (threading, logging, datetime)
network library
Many examples
Muduo-udns Non-blocking DNS resolving
Muduo-protorpc
Asynchronous bidirectional RPC based on Muduo
Also has Java bindings with Netty
Examples: zurg – a master/slaves service mgmt sys
Paxos – a consensus algorithm* (to be written)
2012/06 www.chenshuo.com
39. Check-ins per week
39
From 2010-03 to 2012-06
20
18
16
14
12
10
8
6
4
2
0
2012/06 www.chenshuo.com
41. Bonus Slides
41
Synchronous vs. asynchronous
Basic network performance metrics
Simply wrong and misleading
2012/06 www.chenshuo.com
42. Synchronous vs. asynchronous IO
42
Epoll is synchronous
Select/poll/epoll are O(N), but N stands differently
Anything but aio_* are synchronous
Non-blocking IO is synchronous
you call it, it returns. It never breaks/interrupt code flow
The only thing that can be blocking in event-driven
program are epoll_wait and pthread_cond_wait
pthread_mutex_lock should almost not real block anything
Asynchronous IO is not practical in Linux
Either simulated with threads,
Or notify with signal, not good for multithreaded app
2012/06 www.chenshuo.com
43. TCP/IP over 1Gb Ethernet
43
Ethernet frame Raw b/w 125MB/s
Preamble 8B Packet per second
MAC 12B Max 1,488,000
Type 2B Min 81,274 (no jumbo)
Payload 46~1500B TCP/IP overhead
IPheader 20B
CRC 4B
TCP header 20B
Gap 12B
TCP option 12B (TSopt)
Total 84~1538B
Max TCP throughput
2012/06 112MB/s 81274*(1500-52)
www.chenshuo.com
45. Back-of-the-envelope calculation
45
Read 1MB from net, ~10ms
Copy 1MB in memory, ~0.2ms on old E5150
Copying is not a sin, CPU and memory are so fast
Decode byte string to Message objects
500MB/sdecoding in IO thread, pass ptr to calc thr
50MB/s copy data to calc threads, decode there
Compress or not ? 200MB/s 2x ratio 10MB
10Mb ADSL 8s vs. 4.05s
1000Mb LAN 0.08s vs. 0.09s
2012/06 Redo for 10GbE, InfiniBand www.chenshuo.com
46. High Performance ???
46
Network application in user land
Network service in kernel
TCP/IP stack or network adaptor driver in kernel
Network device (switch/router)
Special purpose OS for network device (firmware)
Special purpose chips for network device (NP)
Control network adaptor with FPGAs
Coding in Verilog, hardwire logic
2012/06 www.chenshuo.com