Speaker: Konrad Malawski
Language: English
It's the year 2015, so unless you've been living under a rock for the last decade, you probably have heard about servers and platforms needing to go asynchronous in order to scale. But really, how deep did you dive into the reasons as why this need arrises? This talk aims to explain the various reasons and techniques that can be (and often are) used in developing high performance web applications - from the kernel depths, to the high level abstractions that all contribute to such designs.
We'll start with the lowest level of them all - the network transports we all use and how they impact latency in our systems.
Then we will move on to operating systems' socket selector implementation details and the now legendary C10K problem, to see how implementations were forced to change in order to survive the ever-rising number of concurrent connections. Next we'll dive into processor and thread utilisation effects and how parallel programming - using either message-passing or stream processing style libraries fits into the grand picture of pursuing the most stable and lowest latency characteristics we could dream of.
Visit our website: http://atmosphere-conference.com/
The new Actor representation in Akka Typed allows formulations that lend themselves to monadic interpretation or introspection. This leads us to explore possibilities for expressing and verifying dynamic properties like the adherence to a communication protocol between multiple agents as well as the safety properties of that protocol on a global level. Academic research in this area is far from complete, but there are interesting initial results that we explore in this session: precisely how much purity and reasoning can we bring to the distributed world?
Peter Lawrey is the CEO of Chronicle Software. He has 7 years experience working as a Java developer for investment banks and trading firms. Chronicle Software helps companies migrate to high performance Java code and was involved in one of the first large Java 8 projects in production in December 2014. The company offers workshops, training, consulting and custom development services. The talk will cover reading and writing lambdas, capturing vs non-capturing lambdas, transforming imperative code to streams, mixing imperative and functional code, and taking Q&A.
What are some of the performance implications of using lambdas and what strategies can be used to address these. When might be want an alternative to using a lambda and how can we design our APIs to be flexible in this regard. What are the principles of writing low latency code in Java? How do we tune and optimize our code for low latency? When don’t we optimize our code? Where does the JVM help and where does it get in our way? How does this apply to lambdas? How can we design our APIs to use lambdas and minimize garbage?
Organizing the world of CQ rest infinitive possibilities by Arkadiusz KitaAEM HUB
This document discusses the CQ Unix Toolkit, an open source set of tools for interacting with Adobe Experience Manager (AEM) and Content Queries (CQ) via REST APIs. It provides examples of use cases like package management, monitoring, and development tasks. Guidelines are given for developing new tools, such as capturing common requests, writing clear usage documentation, using descriptive code, and handling options and dependencies simply. The goal is to organize the world of AEM/CQ REST APIs in a user-friendly way.
Real world functional reactive programmingEric Polerecky
FRP is about programming with asynchronous data streams declaratively. Reactive programming treats everything as an asynchronous data stream. FRP uses concepts from functional programming like immutable data and first class functions. The key abstraction in FRP is IObservable which represents a stream of events or values over time. FRP is useful for handling events, stateful applications, and incoming data streams from sources like the file system, sensors, or HTTP requests.
Poster: Comparing ATS and VeriFast on RTOS system stateKiwamu Okabe
The document discusses using the ATS programming language to model and verify the system state in ChibiOS/RT, a real-time operating system. ATS is able to represent the state machine of the ChibiOS/RT system state using dependent types. This allows errors from calling system APIs in the wrong system state to be caught at compile time rather than causing undefined runtime behavior. The document provides examples of ChibiOS/RT system API classifications and restrictions on their valid call states. It links to an ATS library that implements modeling of the ChibiOS/RT system state using ATS types.
This document discusses memory models, non-blocking primitives, and lock-free algorithms for concurrent programming. It provides code examples for implementing atomic operations like set, compareAndSet, and lazySet using the Unsafe class. It evaluates the performance of different producer-consumer algorithms like spin-wait, co-operative yielding, and buffering. The document suggests buffering generally performs best by avoiding busy-waiting and allowing other threads to run. It provides references for further information on lock-free programming.
Ash Furrow shares his recent real-world experience with Swift as a case study in an evaluation of Swift's production readiness. He provides a chance of taking advantage of the lessons they learned to make the best decisions about Swift.
The new Actor representation in Akka Typed allows formulations that lend themselves to monadic interpretation or introspection. This leads us to explore possibilities for expressing and verifying dynamic properties like the adherence to a communication protocol between multiple agents as well as the safety properties of that protocol on a global level. Academic research in this area is far from complete, but there are interesting initial results that we explore in this session: precisely how much purity and reasoning can we bring to the distributed world?
Peter Lawrey is the CEO of Chronicle Software. He has 7 years experience working as a Java developer for investment banks and trading firms. Chronicle Software helps companies migrate to high performance Java code and was involved in one of the first large Java 8 projects in production in December 2014. The company offers workshops, training, consulting and custom development services. The talk will cover reading and writing lambdas, capturing vs non-capturing lambdas, transforming imperative code to streams, mixing imperative and functional code, and taking Q&A.
What are some of the performance implications of using lambdas and what strategies can be used to address these. When might be want an alternative to using a lambda and how can we design our APIs to be flexible in this regard. What are the principles of writing low latency code in Java? How do we tune and optimize our code for low latency? When don’t we optimize our code? Where does the JVM help and where does it get in our way? How does this apply to lambdas? How can we design our APIs to use lambdas and minimize garbage?
Organizing the world of CQ rest infinitive possibilities by Arkadiusz KitaAEM HUB
This document discusses the CQ Unix Toolkit, an open source set of tools for interacting with Adobe Experience Manager (AEM) and Content Queries (CQ) via REST APIs. It provides examples of use cases like package management, monitoring, and development tasks. Guidelines are given for developing new tools, such as capturing common requests, writing clear usage documentation, using descriptive code, and handling options and dependencies simply. The goal is to organize the world of AEM/CQ REST APIs in a user-friendly way.
Real world functional reactive programmingEric Polerecky
FRP is about programming with asynchronous data streams declaratively. Reactive programming treats everything as an asynchronous data stream. FRP uses concepts from functional programming like immutable data and first class functions. The key abstraction in FRP is IObservable which represents a stream of events or values over time. FRP is useful for handling events, stateful applications, and incoming data streams from sources like the file system, sensors, or HTTP requests.
Poster: Comparing ATS and VeriFast on RTOS system stateKiwamu Okabe
The document discusses using the ATS programming language to model and verify the system state in ChibiOS/RT, a real-time operating system. ATS is able to represent the state machine of the ChibiOS/RT system state using dependent types. This allows errors from calling system APIs in the wrong system state to be caught at compile time rather than causing undefined runtime behavior. The document provides examples of ChibiOS/RT system API classifications and restrictions on their valid call states. It links to an ATS library that implements modeling of the ChibiOS/RT system state using ATS types.
This document discusses memory models, non-blocking primitives, and lock-free algorithms for concurrent programming. It provides code examples for implementing atomic operations like set, compareAndSet, and lazySet using the Unsafe class. It evaluates the performance of different producer-consumer algorithms like spin-wait, co-operative yielding, and buffering. The document suggests buffering generally performs best by avoiding busy-waiting and allowing other threads to run. It provides references for further information on lock-free programming.
Ash Furrow shares his recent real-world experience with Swift as a case study in an evaluation of Swift's production readiness. He provides a chance of taking advantage of the lessons they learned to make the best decisions about Swift.
The document contains a series of nonsensical symbols and text fragments with no clear meaning. It includes programming language keywords and testing concepts like properties, mocking, concurrency, and metrics but does not form coherent sentences.
The Parenscript Common Lisp to JavaScript compilerVladimir Sedach
The document discusses the Parenscript Common Lisp to JavaScript compiler. It describes what Parenscript is and is not, how it works, and its history and uses. Key points include that Parenscript compiles Common Lisp to readable JavaScript code without runtime dependencies or new types, and is used in web frameworks, libraries, and commercial projects.
DASP Top10 for OWASP Thailand Chapter by s111s s111s object
Decentralized Appliaction Security Project Top 10 (DASP Top 10) by s111s
cover 10 topic in DASP Top 10 2018
- Reentrancy
- Access Control
- Arithmetic
- Unchecked Low Level Calls
- Denial of Services
- Bad Randomness
- Front Running
- Time Manipulation
- Short Addresses
- Unknown Unknows
The document discusses Node.js, which is a server-side JavaScript environment that uses an asynchronous event-driven model. Some key points:
- Node.js uses the V8 JavaScript engine and allows handling requests via JavaScript on the server-side rather than a separate language like PHP, Java, etc.
- It has non-blocking I/O to avoid blocking the entire process when waiting for slow resources like files or databases. Callbacks are used to handle asynchronous operations.
- The document discusses how Node.js could provide access to MUMPS databases to take advantage of the benefits of global storage while using the popular JavaScript language.
This document provides a tutorial on using ParenScript, a tool for embedding Lisp code into JavaScript and HTML documents. It demonstrates several examples of using ParenScript, including embedding a simple onclick handler, generating a JavaScript file from ParenScript code, and rewriting an existing slideshow script in ParenScript. The slideshow example shows how to integrate data from Common Lisp into the generated JavaScript code to customize the behavior. Overall, the tutorial provides a good introduction to basic ParenScript usage and concepts through examples.
This document discusses using Docker containers with Java applications and the JVM. It covers the motivation for using Docker with Java, how Docker and the JVM work, and tools for monitoring resources like CPU and memory when applications are containerized. It also provides examples of problems that can occur with thread pools, memory usage, and CPU utilization when Java applications are deployed in Docker and strategies for addressing these issues.
The document discusses behavioral reflection and metaprogramming techniques in Smalltalk. It introduces sub-method structures like bytecode, the ByteSurgeon library for bytecode transformation, and Geppetto which enables partial behavioral reflection through hooksets and metaobjects. This allows profiling and caching to be selectively added to applications at runtime without restarting the system. Future work includes improving tool support and integrating with AST representations.
CLS & asyncListener: asynchronous observability for Node.jsForrest Norvell
Slides from my presentation at PDXNode in October 2013 before RealtimeConf. Thanks to Tracy Abrahms, Ben Acker, and the rest of the PDXNode community for accommodating and hosting me at the last minute!
The document discusses working with bytecode through the use of two tools: IRBuilder and ByteSurgeon. IRBuilder allows for easy generation of bytecode by providing a symbolic assembler interface. ByteSurgeon allows for transformation of existing bytecode through insertion, deletion, and replacement of instructions. Advanced features of ByteSurgeon like metavariables allow access to values on the stack before and after method sends for instrumentation purposes like logging.
This document summarizes upcoming language features in Java, including local variable type inference, raw string literals, expression switch, pattern matching, records, and value types. It discusses the motivation and design of each feature, providing examples. The document indicates that Java releases will now occur every six months and language changes will be more frequent, with new features targeting each release.
Snabb Switch: Riding the HPC wave to simpler, better network appliances (FOSD...Igalia
By Katerina Barone-Adesi.
Driven by the needs of scientific computing, rapid rises in memory bandwidth have made it possible to implement high-performance network functions in a radically simpler way. Snabb Switch rides this wave, bypassing the kernel to process network packets in terse Lua, leaving the programmer free to focus on the essence of their problem. This talk presents our experiences delivering a carrier-grade implementation of "lightweight 4 over 6", an IPv4-as-a-service architecture that tunnels access to the IPv4 internet through specialized Snabb appliances.
We report on our recent experience implementing a carrier-grade virtualized network function, with observations on what it is like to build real-world, high-performance Snabb applications. (and kernel bypass). Each instance runs at essentially line speed on two ten-gigabit Ethernet cards.
Lightweight 4-over-6 (lw4o6) defines an IPv4-as-a-service architecture that allows ISPs to internally operate an IPv6-only network, tunneling IPv4 connections between lw4o6-aware endpoints installed at the customer's site (e.g. in OpenWRT) and an internet-facing "lwAFTR". Lw4o6 was specified in 2015 as RFC 7596 and has the architectural advantage that the carrier-side lwAFTR only needs per-customer state, not per-flow state. An lw4o6 system can also be configured to share IPv4 addresses between multiple customers as part of an IPv4 exhaustion strategy. It allows IPv4 networks to interoperate smoothly, while a carrier between them runs a pure-IPv6 network.
Igalia has built an open source "lwAFTR" implementation that is ready to deploy in production. We describe the joys of hacking with Snabb, giving a quick intro to Snabb, modern x86, and lw4o6 along the way.
(c) 2016 FOSDEM VZW
CC BY 2.0 BE
https://archive.fosdem.org/2016/
Node has captured the attention of early adopters by clearly differentiating itself as being asynchronous from the ground up while remaining accessible. Now that server side JavaScript is at the cutting edge of the asynchronous, real time web, it is in a much better position to establish itself as the go to language for also making synchronous, CRUD webapps and gain a stronger foothold on the server.
This talk covers the current state of server side JavaScript beyond Node. It introduces Common Node, a synchronous CommonJS compatibility layer using node-fibers which bridges the gap between the different platforms. We look into Common Node's internals, compare its performance to that of other implementations such as RingoJS and go through some ideal use cases.
"WTF is Twisted? (or; owl amongst the ponies)" is a talk that introduces the Twisted asynchronous programming framework, how it works, and what uses it.
The document discusses working with bytecodes in Smalltalk. It describes reasons for working with bytecodes like generating bytecode, implementing compilers, and analyzing programs. It provides an overview of Squeak bytecodes and examples of generating and decoding bytecodes. Key frameworks discussed for working with bytecodes are IRBuilder for generating bytecode, InstructionStream for parsing bytecode, and ContextPart for interpreting bytecode.
The document discusses various techniques for implementing reflection in object-oriented programming languages like Smalltalk. It describes approaches for controlling message passing through minimal objects, anonymous classes, and method substitution. Minimal objects intercept messages using doesNotUnderstand:, while anonymous classes are inserted between instances and their classes to control lookup. Method substitution directly replaces methods to add control. The document analyzes the tradeoffs of different reflective approaches.
Salvatore Sanfilippo – How Redis Cluster works, and why - NoSQL matters Barce...NoSQLmatters
Salvatore Sanfilippo – How Redis Cluster works, and why
In this talk the algorithmic details of Redis Cluster will be exposed in order to show what were the design tensions in the clustered version of an high performance database supporting complex data type, the selected tradeoffs, and their effect on the availability and consistency of the resulting solution.Other non-chosen solutions in the design space will be illustrated for completeness.
This document provides examples of common SQL anti-patterns and related NoSQL alternatives. It discusses issues like using tables as trees, caches, queues, or logs. It also addresses dynamic schema/table creation, stored procedures, row padding, complex joins, and object-relational mismatches. The document recommends alternatives like document databases, key-value stores, message brokers, and denormalization. It includes examples of modeling book data in MongoDB and Redis.
The document provides an overview of asynchronous processing and how it relates to scalability and performance. It discusses key topics like sync vs async, scheduling, latency measurement, concurrent vs lock-free vs wait-free data structures, I/O models like IO, AIO, NIO, zero-copy, and sorting algorithms. It emphasizes picking the right tools for the job and properly benchmarking and measuring performance.
Need for Async: Hot pursuit for scalable applicationsKonrad Malawski
This document discusses asynchronous processing and how it relates to scalability and performance. It begins with an introduction on why asynchronous processing is important for highly parallel systems. It then covers topics like asynchronous I/O, scheduling, latency measurement, concurrent data structures, and techniques for distributed systems like backup requests and combined requests. The overall message is that asynchronous programming allows more efficient use of resources through approaches like non-blocking I/O, and that understanding these principles is key to building scalable applications.
The document contains a series of nonsensical symbols and text fragments with no clear meaning. It includes programming language keywords and testing concepts like properties, mocking, concurrency, and metrics but does not form coherent sentences.
The Parenscript Common Lisp to JavaScript compilerVladimir Sedach
The document discusses the Parenscript Common Lisp to JavaScript compiler. It describes what Parenscript is and is not, how it works, and its history and uses. Key points include that Parenscript compiles Common Lisp to readable JavaScript code without runtime dependencies or new types, and is used in web frameworks, libraries, and commercial projects.
DASP Top10 for OWASP Thailand Chapter by s111s s111s object
Decentralized Appliaction Security Project Top 10 (DASP Top 10) by s111s
cover 10 topic in DASP Top 10 2018
- Reentrancy
- Access Control
- Arithmetic
- Unchecked Low Level Calls
- Denial of Services
- Bad Randomness
- Front Running
- Time Manipulation
- Short Addresses
- Unknown Unknows
The document discusses Node.js, which is a server-side JavaScript environment that uses an asynchronous event-driven model. Some key points:
- Node.js uses the V8 JavaScript engine and allows handling requests via JavaScript on the server-side rather than a separate language like PHP, Java, etc.
- It has non-blocking I/O to avoid blocking the entire process when waiting for slow resources like files or databases. Callbacks are used to handle asynchronous operations.
- The document discusses how Node.js could provide access to MUMPS databases to take advantage of the benefits of global storage while using the popular JavaScript language.
This document provides a tutorial on using ParenScript, a tool for embedding Lisp code into JavaScript and HTML documents. It demonstrates several examples of using ParenScript, including embedding a simple onclick handler, generating a JavaScript file from ParenScript code, and rewriting an existing slideshow script in ParenScript. The slideshow example shows how to integrate data from Common Lisp into the generated JavaScript code to customize the behavior. Overall, the tutorial provides a good introduction to basic ParenScript usage and concepts through examples.
This document discusses using Docker containers with Java applications and the JVM. It covers the motivation for using Docker with Java, how Docker and the JVM work, and tools for monitoring resources like CPU and memory when applications are containerized. It also provides examples of problems that can occur with thread pools, memory usage, and CPU utilization when Java applications are deployed in Docker and strategies for addressing these issues.
The document discusses behavioral reflection and metaprogramming techniques in Smalltalk. It introduces sub-method structures like bytecode, the ByteSurgeon library for bytecode transformation, and Geppetto which enables partial behavioral reflection through hooksets and metaobjects. This allows profiling and caching to be selectively added to applications at runtime without restarting the system. Future work includes improving tool support and integrating with AST representations.
CLS & asyncListener: asynchronous observability for Node.jsForrest Norvell
Slides from my presentation at PDXNode in October 2013 before RealtimeConf. Thanks to Tracy Abrahms, Ben Acker, and the rest of the PDXNode community for accommodating and hosting me at the last minute!
The document discusses working with bytecode through the use of two tools: IRBuilder and ByteSurgeon. IRBuilder allows for easy generation of bytecode by providing a symbolic assembler interface. ByteSurgeon allows for transformation of existing bytecode through insertion, deletion, and replacement of instructions. Advanced features of ByteSurgeon like metavariables allow access to values on the stack before and after method sends for instrumentation purposes like logging.
This document summarizes upcoming language features in Java, including local variable type inference, raw string literals, expression switch, pattern matching, records, and value types. It discusses the motivation and design of each feature, providing examples. The document indicates that Java releases will now occur every six months and language changes will be more frequent, with new features targeting each release.
Snabb Switch: Riding the HPC wave to simpler, better network appliances (FOSD...Igalia
By Katerina Barone-Adesi.
Driven by the needs of scientific computing, rapid rises in memory bandwidth have made it possible to implement high-performance network functions in a radically simpler way. Snabb Switch rides this wave, bypassing the kernel to process network packets in terse Lua, leaving the programmer free to focus on the essence of their problem. This talk presents our experiences delivering a carrier-grade implementation of "lightweight 4 over 6", an IPv4-as-a-service architecture that tunnels access to the IPv4 internet through specialized Snabb appliances.
We report on our recent experience implementing a carrier-grade virtualized network function, with observations on what it is like to build real-world, high-performance Snabb applications. (and kernel bypass). Each instance runs at essentially line speed on two ten-gigabit Ethernet cards.
Lightweight 4-over-6 (lw4o6) defines an IPv4-as-a-service architecture that allows ISPs to internally operate an IPv6-only network, tunneling IPv4 connections between lw4o6-aware endpoints installed at the customer's site (e.g. in OpenWRT) and an internet-facing "lwAFTR". Lw4o6 was specified in 2015 as RFC 7596 and has the architectural advantage that the carrier-side lwAFTR only needs per-customer state, not per-flow state. An lw4o6 system can also be configured to share IPv4 addresses between multiple customers as part of an IPv4 exhaustion strategy. It allows IPv4 networks to interoperate smoothly, while a carrier between them runs a pure-IPv6 network.
Igalia has built an open source "lwAFTR" implementation that is ready to deploy in production. We describe the joys of hacking with Snabb, giving a quick intro to Snabb, modern x86, and lw4o6 along the way.
(c) 2016 FOSDEM VZW
CC BY 2.0 BE
https://archive.fosdem.org/2016/
Node has captured the attention of early adopters by clearly differentiating itself as being asynchronous from the ground up while remaining accessible. Now that server side JavaScript is at the cutting edge of the asynchronous, real time web, it is in a much better position to establish itself as the go to language for also making synchronous, CRUD webapps and gain a stronger foothold on the server.
This talk covers the current state of server side JavaScript beyond Node. It introduces Common Node, a synchronous CommonJS compatibility layer using node-fibers which bridges the gap between the different platforms. We look into Common Node's internals, compare its performance to that of other implementations such as RingoJS and go through some ideal use cases.
"WTF is Twisted? (or; owl amongst the ponies)" is a talk that introduces the Twisted asynchronous programming framework, how it works, and what uses it.
The document discusses working with bytecodes in Smalltalk. It describes reasons for working with bytecodes like generating bytecode, implementing compilers, and analyzing programs. It provides an overview of Squeak bytecodes and examples of generating and decoding bytecodes. Key frameworks discussed for working with bytecodes are IRBuilder for generating bytecode, InstructionStream for parsing bytecode, and ContextPart for interpreting bytecode.
The document discusses various techniques for implementing reflection in object-oriented programming languages like Smalltalk. It describes approaches for controlling message passing through minimal objects, anonymous classes, and method substitution. Minimal objects intercept messages using doesNotUnderstand:, while anonymous classes are inserted between instances and their classes to control lookup. Method substitution directly replaces methods to add control. The document analyzes the tradeoffs of different reflective approaches.
Salvatore Sanfilippo – How Redis Cluster works, and why - NoSQL matters Barce...NoSQLmatters
Salvatore Sanfilippo – How Redis Cluster works, and why
In this talk the algorithmic details of Redis Cluster will be exposed in order to show what were the design tensions in the clustered version of an high performance database supporting complex data type, the selected tradeoffs, and their effect on the availability and consistency of the resulting solution.Other non-chosen solutions in the design space will be illustrated for completeness.
This document provides examples of common SQL anti-patterns and related NoSQL alternatives. It discusses issues like using tables as trees, caches, queues, or logs. It also addresses dynamic schema/table creation, stored procedures, row padding, complex joins, and object-relational mismatches. The document recommends alternatives like document databases, key-value stores, message brokers, and denormalization. It includes examples of modeling book data in MongoDB and Redis.
The document provides an overview of asynchronous processing and how it relates to scalability and performance. It discusses key topics like sync vs async, scheduling, latency measurement, concurrent vs lock-free vs wait-free data structures, I/O models like IO, AIO, NIO, zero-copy, and sorting algorithms. It emphasizes picking the right tools for the job and properly benchmarking and measuring performance.
Need for Async: Hot pursuit for scalable applicationsKonrad Malawski
This document discusses asynchronous processing and how it relates to scalability and performance. It begins with an introduction on why asynchronous processing is important for highly parallel systems. It then covers topics like asynchronous I/O, scheduling, latency measurement, concurrent data structures, and techniques for distributed systems like backup requests and combined requests. The overall message is that asynchronous programming allows more efficient use of resources through approaches like non-blocking I/O, and that understanding these principles is key to building scalable applications.
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...apidays
Apidays Paris 2023 - Software and APIs for Smart, Sustainable and Sovereign Societies
December 6, 7 & 8, 2023
Forget TypeScript, Choose Rust to build Robust, Fast and Cheap APIs
Zacaria Chtatar, Backend Software Engineer at HaveSomeCode
------
Check out our conferences at https://www.apidays.global/
Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8
Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io
Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/
The document discusses the end of increasing processor clock speeds and the rise of multi-core processors, necessitating concurrent programming. It covers challenges with locks and conditions variables for concurrency including composition issues. Software transactional memory (STM) is presented as an alternative that allows for composable concurrent operations through atomic blocks and transactional variables. While STM avoids issues like deadlocks, side effects and performance under high contention are concerns.
This document provides an introduction and overview of Cassandra and NoSQL databases. It discusses the challenges faced by modern web applications that led to the development of NoSQL databases. It then describes Cassandra's data model, API, consistency model, and architecture including write path, read path, compactions, and more. Key features of Cassandra like tunable consistency levels and high availability are also highlighted.
Node has revolutionized modern runtimes. Their async by default strategy boasts 3x the throughput of Java. And yet, the language runs 5x slower than C++ (when JS is interpreted).
This talk is an advanced intro into the world of Node where we take a closer look under the hood. What's the event loop? Why are there multiple compilers for JS in Node/V8? How many threads are actually used in Node and for what purpose? We'll answer these questions and more as we go over libuv, v8, the node core library, npm, and more.
If you're developing with Node, want to start, or are just curious about how it works, please check it out!
Rust promises developers the execution speed of non-managed languages like C++, with the safety guarantees of managed languages like Go. Its fast rise in popularity shows this promise has been largely upheld.
However, the situation is a bit muddier for the newer asynchronous extensions. This talk will explore some of the pitfalls that users may face while developing asynchronous Rust applications that have direct consequences in their ability to hit that sweet low p99. We will see how the Glommio asynchronous executor tries to deal with some of those problems, and what the future holds.
Streams allow connecting programs like connecting garden hoses. They provide a way to pipe input through multiple steps to an output. There are different types of streams like readable, writable, duplex, and transform streams. Common uses of streams in Node.js include http, fs, child processes, tcp, and zlib. Streams are event emitters that can be used to process data incrementally instead of all at once.
Inside the JVM - Follow the white rabbit! / Breizh JUGSylvain Wallez
Presentation given at the Rennes (FR) Java User Group in Feb 2019.
How do we go from your Java code to the CPU assembly that actually runs it? Using high level constructs has made us forget what happens behind the scenes, which is however key to write efficient code.
Starting from a few lines of Java, we explore the different layers that constribute to running your code: JRE, byte code, structure of the OpenJDK virtual machine, HotSpot, intrinsic methds, benchmarking.
An introductory presentation to these low-level concerns, based on the practical use case of optimizing 6 lines of code, so that hopefully you to want to explore further!
Kafka Summit NYC 2017 - Running Hundreds of Kafka Clusters with 5 Peopleconfluent
Tom Crayford discusses his experience running hundreds of Apache Kafka clusters on Heroku with a small team. Some key points discussed include:
- Using automation to manage clusters and reduce manual work required
- Common issues encountered like disk growth from log compaction bugs and addressing them by scanning clusters for anomalies
- Kafka's built-in high availability and how it helped during an AWS EBS failure event
- Novel failure cases encountered like a JVM memory leak from gzip usage and working to fix it
- Importance of taking breaks and not wasting time when operating clusters at scale.
This document discusses programming concepts in Perl including variables, flow control, loops, input/output, and subroutines. It provides examples of using different data types like scalars, arrays, and hashes. It also covers reading and writing files in Perl using filehandles, and handling errors when opening files. The document emphasizes best practices for programming in Perl such as developing code in stages, showing activity when running interactively, using comments, and choosing a consistent coding convention.
- Xslate is a template engine for Perl5 that is written in C using XS. It aims to be fast, safe from XSS attacks, and support multiple template syntaxes including Kolon and TTerse.
- Xslate templates are first preprocessed, parsed into an AST, compiled into bytecode, and then executed by a virtual machine for high performance. Automatic HTML escaping also helps prevent XSS issues.
- Future goals include adding features like loop controls and context controls, as well as exploring more template syntaxes and better integrations with web frameworks.
This document provides an overview of Konrad Malawski's presentation on reactive stream processing with Akka Streams. The presentation covers Reactive Streams concepts like back pressure, the Reactive Streams specification and protocol, and how Akka Streams implements reactive stream processing using concepts like linear flows, flow graphs, and integration with Akka actors. It also discusses future plans for Akka Streams including API stabilization, improved testability, and potential features like visualizing flow graphs and distributing computation graphs.
Keynote: Building and Operating A Serverless Streaming Runtime for Apache Bea...Flink Forward
Apache Beam is Flink’s sibling in the Apache family of streaming processing frameworks. The Beam and Flink teams work closely together on advancing what is possible in streaming processing, including Streaming SQL extensions and code interoperability on both platforms.
Beam was originally developed at Google as the amalgamation of its internal batch and streaming frameworks to power the exabyte-scale data processing for Gmail, YouTube and Ads. It now powers a fully-managed, serverless service Google Cloud Dataflow, as well as is available to run in other Public Clouds and on-premises when deployed in portability mode on Apache Flink, Spark, Samza and other runners. Users regularly run distributed data processing jobs on Beam spanning tens of thousands of CPU cores and processing millions of events per second.
In this session, Sergei Sokolenko, Cloud Dataflow product manager, and Reuven Lax, the founding member of the Dataflow and Beam team, will share Google’s learnings from building and operating a global streaming processing infrastructure shared by thousands of customers, including:
safe deployment to dozens of geographic locations,
resource autoscaling to minimize processing costs,
separating compute and state storage for better scaling behavior,
dynamic work rebalancing of work items away from overutilized worker nodes,
offering a throughput-optimized batch processing capability with the same API as streaming,
grouping and joining of 100s of Terabytes in a hybrid in-memory/on-desk file system,
integrating with the Google Cloud security ecosystem, and other lessons.
Customers benefit from these advances through faster execution of jobs, resource savings, and a fully managed data processing environment that runs in the Cloud and removes the need to manage infrastructure.
Fixed width data can be processed efficiently in Perl using forks and shared file handles. This talk describes the basic mechanism and alternatives for improving the performance in dealing with the records.
This document provides an overview of CBStreams, a ColdFusion module that implements Java Streams functionality for processing data in a functional programming style. It discusses key concepts like lazy evaluation, intermediate operations that transform streams, and terminal operations that produce final results. Examples are given for building streams from various data sources, applying filters, maps, reductions and more. Lambda expressions and closures play an important role in functional-style stream processing.
Transactions and Concurrency Control PatternsJ On The Beach
Transactions and Concurrency Control Patterns by Vlad Mihalcea
Transactions and Concurrency Control are very of paramount importance when it comes to enterprise systems data integrity. However, this topic is very tough since you have to understand the inner workings of the database system, its concurrency control design choices (e.g. 2PL, MVCC), transaction isolation levels and locking schemes.
In this presentation, I’m going to explain what data anomalies can happen depending on the transaction isolation level, with references to Oracle, SQL Server, PostgreSQL, and MySQL.
I will also demonstrate that database transactions are not enough, especially for multi-request web flows. For this reason, I’m going to present multiple application-level transaction patterns based on both optimistic and pessimistic locking mechanisms.
Last, I’m going to talk about Concurrency Control strategies used in the Hibernate second-level caching mechanism, which can boost performance without compromising strong consistency.
Similar to Atmosphere Conference 2015: Need for Async: In pursuit of scalable internet-scale applications (20)
Securing BGP: Operational Strategies and Best Practices for Network Defenders...APNIC
Md. Zobair Khan,
Network Analyst and Technical Trainer at APNIC, presented 'Securing BGP: Operational Strategies and Best Practices for Network Defenders' at the Phoenix Summit held in Dhaka, Bangladesh from 23 to 24 May 2024.
Discover the benefits of outsourcing SEO to Indiadavidjhones387
"Discover the benefits of outsourcing SEO to India! From cost-effective services and expert professionals to round-the-clock work advantages, learn how your business can achieve digital success with Indian SEO solutions.
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...APNIC
Adli Wahid, Senior Internet Security Specialist at APNIC, delivered a presentation titled 'Honeypots Unveiled: Proactive Defense Tactics for Cyber Security' at the Phoenix Summit held in Dhaka, Bangladesh from 23 to 24 May 2024.
HijackLoader Evolution: Interactive Process HollowingDonato Onofri
CrowdStrike researchers have identified a HijackLoader (aka IDAT Loader) sample that employs sophisticated evasion techniques to enhance the complexity of the threat. HijackLoader, an increasingly popular tool among adversaries for deploying additional payloads and tooling, continues to evolve as its developers experiment and enhance its capabilities.
In their analysis of a recent HijackLoader sample, CrowdStrike researchers discovered new techniques designed to increase the defense evasion capabilities of the loader. The malware developer used a standard process hollowing technique coupled with an additional trigger that was activated by the parent process writing to a pipe. This new approach, called "Interactive Process Hollowing", has the potential to make defense evasion stealthier.
6. High Performance Software Development
For the majority of the time,
high performance software development
is not about compiler hacks and bit twiddling.
It is about fundamental design principles that are
key to doing any effective software development.
Martin Thompson
practicalperformanceanalyst.com/2015/02/17/getting-to-know-martin-thompson-...
7. Agenda
• Why?
• Async and Synch basics / definitions
• Back-pressure applied
• Async where it matters: Scheduling
• How NOT to measure Latency
• Concurrent < lock-free < wait-free
• I/O: IO, AIO, NIO, Zero
• C10K: select, poll, epoll / kqueue
• Distributed Systems: Where Async is at Home
• Wrapping up and Q/A
61. Latency Quiz
Gil Tene style, see:“How NOT to Measure Latency”
Is 10s latency acceptable in your app?
Is 200ms latency acceptable?
How about most responses within 200ms?
So mostly 20ms and some 1 minute latencies is OK?
Do people die when we go above 200ms?
So 90% below 200ms, 99% bellow 1s, 99.99% below 2s?
62. Latency in the “real world”
Gil Tene style, see:“How NOT to Measure Latency”
“Our response time is 200ms average,
stddev is around 60ms”
— a typical quote
63. Latency in the “real world”
Gil Tene style, see:“How NOT to Measure Latency”
“Our response time is 200ms average,
stddev is around 60ms”
— a typical quote
Latency does NOT behave like normal distribution!
“So yeah, our 99,99%’ is…”
74. A locks; B tries lock...
A writes;
A unlocks; B acquires the lock...
B (finally) writes & unlocks
What can happen in concurrent data structures:
Concurrent < lock-free < wait-free
75. A locks; B tries lock...
A writes;
A unlocks; B acquires the lock...
B (finally) writes & unlocks
What can happen in concurrent data structures:
Moral?
1) Thread A is not very nice to B.
2) A lot of time is wasted.
Concurrent < lock-free < wait-free
Wastedtime
76. Concurrent < lock-free < wait-less
Concurrency is NOT Parallelism.
Rob Pike - Concurrency is NOT Parallelism (video)
def offer(a: A): Boolean // returns on failure
def add(a: A): Unit // throws on failure
def put(a: A): Boolean // blocks until able to enqueue
77. Concurrent < lock-free < wait-free
concurrent data structure
<
lock-free* data structure
* lock-free a.k.a. lockless
79. An algorithm is lock-free if it satisfies that:
When the program threads are run sufficiently long,
at least one of the threads makes progress.
Concurrent < lock-free < wait-free
80. Concurrent < lock-free < wait-free
What can happen in concurrent data structures:
A tries to write; B tries to write; B wins!
A tries to write; C tries to write; C wins!
A tries to write; D tries to write; D wins!
A tries to write; B tries to write; B wins!
A tries to write; E tries to write; E wins!
A tries to write; F tries to write; F wins!
…
Moral?
1) Thread A is a complete loser.
2) Thread A eventually should be able to progress…
81. * Both versions are used: lock-free / lockless
class CASBackedQueue[A] {
val _queue = new AtomicReference(Vector[A]())
// does not block, may spin though
@tailrec final def put(a: A): Unit = {
val queue = _queue.get
val appended = queue :+ a
if (!_queue.compareAndSet(queue, appended))
put(a)
}
}
Concurrent < lock-free < wait-free
82. class CASBackedQueue[A] {
val _queue = new AtomicReference(Vector[A]())
// does not block, may spin though
@tailrec final def put(a: A): Unit = {
val queue = _queue.get
val appended = queue :+ a
if (!_queue.compareAndSet(queue, appended))
put(a)
}
}
Concurrent < lock-free < wait-free
83. class CASBackedQueue[A] {
val _queue = new AtomicReference(Vector[A]())
// does not block, may spin though
@tailrec final def put(a: A): Unit = {
val queue = _queue.get
val appended = queue :+ a
if (!_queue.compareAndSet(queue, appended))
put(a)
}
}
Concurrent < lock-free < wait-free
90. Concurrent < lock-free < wait-free
“concurrent” data structure
<
lock-free* data structure
<
wait-free data structure
* Both versions are used: lock-free / lockless
91. Concurrent < lock-free < wait-free
Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue Algorithms
Maged M. Michael Michael L. Scott
An algorithm is wait-free if every operation has a bound on
the number of steps the algorithm will take before the
operation completes.
92. wait-free: j.u.c.ConcurrentLinkedQueue
Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue Algorithms
Maged M. Michael Michael L. Scott
public boolean offer(E e) {
checkNotNull(e);
final Node<E> newNode = new Node<E>(e);
for (Node<E> t = tail, p = t;;) {
Node<E> q = p.next;
if (q == null) {
// p is last node
if (p.casNext(null, newNode)) {
// Successful CAS is the linearization point
// for e to become an element of this queue,
// and for newNode to become "live".
if (p != t) // hop two nodes at a time
casTail(t, newNode); // Failure is OK.
return true;
}
// Lost CAS race to another thread; re-read next
}
else if (p == q)
// We have fallen off list. If tail is unchanged, it
// will also be off-list, in which case we need to
// jump to head, from which all live nodes are always
// reachable. Else the new tail is a better bet.
p = (t != (t = tail)) ? t : head;
else
// Check for tail updates after two hops.
p = (p != t && t != (t = tail)) ? t : q;
}
}
This is a modification of the Michael & Scott algorithm,
adapted for a garbage-collected environment, with support
for interior node deletion (to support remove(Object)).
For explanation, read the paper.
97. Synchronous I / O
— Havoc Pennington
(HAL, GNOME, GConf, D-BUS, now Typesafe)
When I learned J2EE about 2008 with some of my
desktop colleagues our reactions included something like:
”wtf is this sync IO crap,
where is the main loop?!” :-)
104. Kernels and CPUs
[…] switching from user-level to kernel-level
on a (2.8 GHz) P4 is 1348 cycles.
[…] Counting actual time, the P4 takes 481ns […]
http://wiki.osdev.org/Context_Switching
120. C10K and beyond
“10.000 concurrent connections”
Not a new problem, pretty old actually: ~12 years old.
http://www.kegel.com/c10k.html
121. C10K and beyond
It’s not about performance.
It’s about scalability.
These are orthogonal things.
Threading differences:
apache httpd / nginx / akka
(1 thread = 1 request) == Very heavy
133. C10K
O(n) is a no-go for epic scalability.
State of Linux scheduling:
O(n) O(1) CFS (O(1)/ O(log n))
And Socket selection:
Select/Poll O(n) EPoll (O(1))
134. C10K
O(n) is a no-go for epic scalability.
State of Linux scheduling:
O(n) O(1) CFS (O(1))
And Socket selection:
Select/Poll O(n) EPoll (O(1))
O(1) IS a go for epic scalability.
Moral:
136. Distributed Systems
“… in which the failure of a computer
you didn't even know existed can
render your own computer unusable.”
— Leslie Lamport
http://research.microsoft.com/en-us/um/people/lamport/pubs/distributed-system.txt
145. Backup requests
Avg Std dev 95%ile 99%ile 99.9%ile
No backups 33 ms 1524 ms 24 ms 52 ms 994 ms
After 10ms 14 ms 4 ms 20 ms 23 ms 50 ms
After 50ms 16 ms 12 ms 57 ms 63 ms 68 ms
Jeff Dean - Achieving Rapid Response Times in Large Online Services
Peter Bailis - Doing Redundant Work to Speed Up Distributed Queries
Akka - Krzysztof Janosz @ Akkathon, Kraków - TailChoppingRouter (docs, pr)
148. Combined requests
A technique for avoiding duplicated work.
By aggregating requests, possibly increasing latency.
“Wat?Why would I increase latency!?”
158. Wrapping up
• Someone has to bite the bullet though!
• We’re all running on real hardware.
• We do it so you don’t have to.
Summing up the goal of this talk:
• Keep your apps pure and simple
• Be aware of internals
• Use libraries which apply these techniques
• Maybe indeed
• Messaging all the way!
These techniques are hard to get right, yet:
159. Links
• akka.io
• reactive-streams.org
• akka-user
• Gil Tene - How NOT to measure latency, 2013
• Jeff Dean @Velocity 2014
• Alan Bateman, Jeanfrancois Arcand (Sun) Async IO Tips @ JavaOne
• http://linux.die.net/man/2/select
• http://linux.die.net/man/2/poll
• http://linux.die.net/man/4/epoll
• giltene/jHiccup
• Linux Journal: ZeroCopy I, Dragan Stancevis 2013
• Last slide car picture: http://actu-moteurs.com/sprint/gt-tour/jean-
philippe-belloc-un-beau-challenge-avec-le-akka-asp-team/2000
160. Links
• http://wiki.osdev.org/Context_Switching
• CppCon: Herb Sutter "Lock-Free Programming (or, Juggling Razor Blades)"
• http://www.infoq.com/presentations/reactive-services-scale
• Gil Tene’s HdrHistogram.org
• http://hdrhistogram.github.io/HdrHistogram/plotFiles.html
• Rob Pike - Concurrency is NOT Parallelism (video)
• Brendan Gregg - Systems Performance: Enterprise and the Cloud (book)
• http://psy-lob-saw.blogspot.com/2015/02/hdrhistogram-better-latency-capture.html
• Jeff Dean, Luiz Andre Barroso - The Tail at Scale (whitepaper,ACM)
• http://highscalability.com/blog/2012/3/12/google-taming-the-long-latency-tail-when-
more-machines-equal.html
• http://www.ulduzsoft.com/2014/01/select-poll-epoll-practical-difference-for-system-
architects/
• Marcus Lagergren - Oracle JRockit:The Definitive Guide (book)
• http://mechanical-sympathy.blogspot.com/2013/08/lock-based-vs-lock-free-
concurrent.html
• Handling of Asynchronous Events - http://www.win.tue.nl/~aeb/linux/lk/lk-12.html
• http://www.kegel.com/c10k.html
161. Links
• www.reactivemanifesto.org/
• Seriously the only right way to micro benchmark on the JVM:
• JMH openjdk.java.net/projects/code-tools/jmh/
• JMH for Scala: https://github.com/ktoso/sbt-jmh
• http://www.ibm.com/developerworks/library/l-async/
• http://lse.sourceforge.net/io/aio.html
• https://code.google.com/p/kernel/wiki/AIOUserGuide
• ShmooCon: C10M - Defending the Internet At Scale (Robert Graham)
• http://blog.erratasec.com/2013/02/scalability-its-question-that-drives-us.html#.VO6E11PF8SM
•User-level threads....... with threads. - Paul Turner @ Linux Plumbers Conf 2013
•Jan Pustelnik’s talk yesterday: https://github.com/gosubpl/sortbench
162. Special thanks to:
• Aleksey Shipilëv
• Andrzej Grzesik
• Gil Tene
• Kirk Pepperdine
• Łukasz Dubiel
• Marcus Lagergren
• Martin Thompson
• Mateusz Dymczyk
• Nitsan Wakart
Thanks guys, you’re awesome.
alphabetically, mostly
• Peter Lawrey
• Richard Warburton
• Roland Kuhn
• Sergey Kuksenko
• Steve Poole
• Viktor Klang a.k.a. √
• Antoine de Saint Exupéry :-)
• and the entire AkkaTeam
• the Mechanical Sympathy Mailing List
163. Learn more at:
• SCKRK.com –
• KrakowScala.pl – Kraków Scala User Group
• LambdaKRK.pl – Lambda Lounge Kraków
• GeeCON.org – awesome “all around the JVM” conference,
[Kraków, Poznań, Prague, and more…!]
Software Craftsmanship Kraków
Computer Science Whitepaper Reading Club Kraków