Thinking in a Highly Concurrent, Mostly-functional Language

Similar documents
2015 Erlang Solutions Ltd

Styling your Architecture in an Evolving Concurrent World

FRANCESCO CESARINI. presents ERLANG/OTP. Francesco Cesarini Erlang

An Introduction to Erlang

An Introduction to Erlang

An Introduction to Erlang

Francesco Cesarini. Concurrency + Distribution = Availability + Scalability.

Scalable ejabberd. Konstantin Tcepliaev. Moscow Erlang Factory Lite June 2012

Erlang. Joe Armstrong.

ERLANG EVOLVES FOR MULTI-CORE AND CLOUD ENVIRONMENTS

Jargons, Concepts, Scope and Systems. Key Value Stores, Document Stores, Extensible Record Stores. Overview of different scalable relational systems

Massive IM Scalability using WebSockets Michał Ślaski

Integrating XMPP based communicator with large scale portal

SEDA: An Architecture for Well-Conditioned, Scalable Internet Services

20 Years of Commercial Functional Programming

Erlang and Concurrency. André Pang Rising Sun Research

Designing for Scalability. Patrick Linskey EJB Team Lead BEA Systems

MongooseIM - Messaging that Scales

CS533 Concepts of Operating Systems. Jonathan Walpole

STATEFUL TCP/UDP traffic generation and analysis

Adobe ColdFusion (2016 release)

All you need is fun. Cons T Åhs Keeper of The Code

Programming Language Impact on the Development of Distributed Systems

Oracle 10g and IPv6 IPv6 Summit 11 December 2003

The Lion of storage systems

Carrier grade VoIP systems with Kamailio

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 4

Erlang-DTrace. Garry Bulmer. Team DTrace: Tim Becker

Diffusion TM 5.0 Performance Benchmarks

Lecture 7: February 10

GnuGk The GNU Gatekeeper

WHITE PAPER NGINX An Open Source Platform of Choice for Enterprise Website Architectures

Redundancy. Cisco Unified Communications Manager Redundancy Groups

TCP Nice: A Mechanism for Background Transfers

Adobe ColdFusion 11 Enterprise Edition

Raghav Karol Motorola Solutions. Torben Hoffmann Motorola Solutions

Distributed systems' architecture. Typical application model. Example ( classic app.) A.Lioy - Politecnico di Torino (2009) A-1

Distributed systems' architecture

CS/IT321. Hall Ticket Number: April, 2017 Sixth Semester Time: Three Hours Answer Question No.1 compulsorily. Answer ONE question from each unit.

Hochperformante Softwarearchitekturen Planung, Zufall oder Erfahrung? Unser Geheimrezept!

Application Layer Introduction; HTTP; FTP

Stream Control Transmission Protocol - Wikipedia, the free encyclopedia

Infiniband Fast Interconnect

Scaling Internet TV Content Delivery ALEX GUTARIN DIRECTOR OF ENGINEERING, NETFLIX

TRANSMISSION CONTROL PROTOCOL. ETI 2506 TELECOMMUNICATION SYSTEMS Monday, 7 November 2016

Active Server Pages Architecture

Memory-Mapped Files. generic interface: vaddr mmap(file descriptor,fileoffset,length) munmap(vaddr,length)

Cloud Programming James Larus Microsoft Research. July 13, 2010

Dimensioning Company Intranets for IT Bandwidth CASE Study for Central Europe Telecom

CS 4300 Computer Graphics

OceanStor 9000 InfiniBand Technical White Paper. Issue V1.01 Date HUAWEI TECHNOLOGIES CO., LTD.

ONE TEAM, FOUR LOCATIONS, THREE TIME ZONES. ONE GOAL.

Interprocess Communication Mechanisms

shared storage These mechanisms have already been covered. examples: shared virtual memory message based signals

Introduction. version 5.0

Adapted from: TRENDS AND ATTRIBUTES OF HORIZONTAL AND VERTICAL COMPUTING ARCHITECTURES

Ultra high-speed transmission technology for wide area data movement

IBM FileNet Content Manager 5.2. Asynchronous Event Processing Performance Tuning

Performance Testing: Respect the Difference

How we scaled push messaging for millions of Netflix devices. Susheel Aroskar Cloud Gateway

Configuring the Oracle Network Environment. Copyright 2009, Oracle. All rights reserved.

RabbitMQ Overview. Tony Garnock-Jones

OO Based Development of a Multi Media Application Server Prototype

Chapter 3 outline. 3.5 Connection-oriented transport: TCP. 3.6 Principles of congestion control 3.7 TCP congestion control

BUILDING A SCALABLE MOBILE GAME BACKEND IN ELIXIR. Petri Kero CTO / Ministry of Games

Architecture of a Real-Time Operational DBMS

Global Servers. The new masters

A10 SSL INSIGHT & SONICWALL NEXT-GEN FIREWALLS

Lightstreamer. The Streaming-Ajax Revolution. Product Insight

WHITE PAPER AGILOFT SCALABILITY AND REDUNDANCY

Copyright 2013

Performance Testing of a Road Tolling System

Understanding Upgrades and Migrations

Evaluating Auto Scalable Application on Cloud

webmethods Task Engine 9.9 on Red Hat Operating System

BEAWebLogic Server. Introduction to BEA WebLogic Server and BEA WebLogic Express

SPDY - A Web Protocol. Mike Belshe Velocity, Dec 2009

Distributed Systems Principles and Paradigms

Copyright Push Technology Ltd December Diffusion TM 4.4 Performance Benchmarks

Performance Evaluation of NoSQL Databases

An Oracle White Paper May Oracle VM 3: Overview of Disaster Recovery Solutions

Samsung SDS Enterprise Cloud

CPSC 441 COMPUTER COMMUNICATIONS MIDTERM EXAM SOLUTION

RADU POPESCU IMPROVING THE WRITE SCALABILITY OF THE CERNVM FILE SYSTEM WITH ERLANG/OTP

Application Layer: OSI and TCP/IP Models

Building a Dynamic and Flexible Exchange Architecture. B S Nagarajan Senior Technology Consultant 6 th November, 2008

Eventually Consistent HTTP with Statebox and Riak

Cliff Moon. Bottleneck Whack-A-Mole. Thursday, March 21, 13

Oracle Database 11g Direct NFS Client Oracle Open World - November 2007

CSC 4900 Computer Networks: End-to-End Design

QLogic TrueScale InfiniBand and Teraflop Simulations

Lecture 11. Transport Layer (cont d) Transport Layer 1

Advances of parallel computing. Kirill Bogachev May 2016

Database Server. 2. Allow client request to the database server (using SQL requests) over the network.

Data Communication & Computer Networks MCQ S

WebRTC: Possible? Don McGregor Research Associate MOVES Institute.

Experiments in OTP-Compliant Dataflow Programming

Prepared by JMeter Group, Summer Interns

Minutes of Meeting of the Designated Technical Bid Evaluation Committee in regard to e-tender for Procurement of UTM at STPI Noida.

1 Adda247 No. 1 APP for Banking & SSC Preparation Website:store.adda247.com

Transcription:

Thinking in a Highly Concurrent, Mostly-functional Language Build Stuff Vilnius, November 19th 2014 Francesco Cesarini Founder & Technical Director @francescoc francesco@erlang-solutions.com

Thinking in a Highly Concurrent, Mostly-functional Language Erlang Training and Consulting Ltd QCON London, March 12 th, 2009 Francesco Cesarini francesco@erlang-consulting.com

counter_loop(count) -> receive increment -> counter_loop(count + 1); {count, To} -> To! {count, Count}, counter_loop(count) end. Erlang

Tim Bray, Director of Web Technologies Sun Microsystems

Tim Bray, Director of Web Technologies Sun Microsystems

Syntax

Concurrency

Erlang Highlights: Concurrency Creating a new process using spawn -module(ex3). -export([activity/3]). activity(name,pos,size) -> activity(joe,75,1024) Pid = spawn(ex3,activity,[joe,75,1024])

Erlang Highlights: Concurrency Processes communicate by asynchronous message passing Pid! {data,12,13} receive {start} -> {stop} -> {data,x,y} -> end

Products: AXD301 Switch - 1996 A Telephony-Class, scalable (10 160 GBps) ATM switch Designed from scratch in less than 3 years AXD 301 Success factors:! Competent organisation and people! Efficient process! Excellent technology (e.g. Erlang/OTP)

Products: AXD301 Switch - 1996 Erlang: ca 1.5 million lines of code! Nearly all the complex control logic! Operation & Maintenance! Web server and runtime HTML/ JavaScript generation C/C++: ca 500k lines of code! Third party software! Low-level protocol drivers! Device drivers Java: ca 13k lines of code! Operator GUI applets

Concurrency Modeling Model for the natural concurrency in your problem In the old days, processes were a critical resource! Rationing processes led to complex and unmanageable code Nowadays, processes are very cheap: if you need a process create one! Example: AXD301 process model 1 st prototype: 6 processes/call 2 processes/call 1 process/all calls 2 processes/ call transaction 4-5 processes/ call transaction

1+1 Redundancy Good ol Telecoms ~ 35 000 calls per processor pair Stable-state replication No ongoing sessions lost at failover Active Standby Control plane User plane Control signalling Device board Data path

First IM Proxy Prototype - 2000 sockets multiplexing de-multiplexing state/error handling de-multiplexing sockets multiplexing listener users

First IM Proxy Prototype - 2000 sockets supervisor multiplexing state/error handling simple 1-1 de-multiplexing sockets multiplexing listener users

Products: EjabberD IM Server - 2002 A distributed XMPP server Started as an Open Source Project by Alexey Shchepin Commercially Supported by Process-One (Paris)! 40% of the XMPP IM market! Used as a transport layer! Managed 30,000 users / node

Products: EjabberD IM Server - 2002 A distributed XMPP server Started as an Open Source project by Alexey Shchepin Commercially Supported by Process-One (Paris)! 40% of the XMPP IM market! Used as a transport layer! 2008, Managed 30,000 users / node MongooseIM is a fork and rewrite! Open Source, supported by Erlang Solutions! Used for Messaging and Device Management! 2014, managed 1 million users / node

Fully Replicated Cluster Ejabberd 2002 Client must re-connect if one of its session handlers dies s2s muc Load balancer s2s c2s muc sm c2s sm s2s c2s muc sm Fully replicated Mnesia database

Share-nothing Architecture Messaging Gateway

Share-nothing Architecture Messaging Gateway Router/FE Router/FE Router/FE Router/FE POP SMTP IMAP... tunnel POP SMTP IMAP... tunnel POP SMTP IMAP... HTTP HTTP DBMS

Erlang Concurrency Under Stress Pre-SMP 100% CPU Throughput / Second Line 1 Balanced Erlang System Line 2 Erlang System with bottle necks Simultaneous Requests

Erlang Concurrency Under Stress Pre-SMP YAWS Throughput (KBytes/second) Simultaneous Requests

Erlang Concurrency Under Stress Post-SMP

Stress Tests With SMP I/O Starvation TCP/IP Congestion Memory Spikes Timeout Fine-tuning OS Limitations ERTS Configuration Flags Shut down Audit Logs

SMP bottlenecks pre 2008

SMP bottlenecks post 2008 Erlang VM Scheduler #1 run queue Scheduler #2 run queue migration logic Scheduler #N run queue

Big Bang Benchmark post 2008 "

Mandelbrot- 2013 "

Now for the Bottlenecks "

Now for the Bottlenecks "

Now for the Bottlenecks

Now for the Bottlenecks www.concurix.com

Now for the Bottlenecks

Riak and other scalable architectures

N/R/W Values 2014 2011 Erlang Erlang Solutions Ltd Solutions Ltd

N/R/W Values 2014 2011 Erlang Erlang Solutions Ltd Solutions Ltd

Clusters and SD Erlang

Release Statement of Aims To scale the radical concurrency-oriented programming paradigm to build reliable general-purpose software, such as serverbased systems, on massively parallel machines (10^5 cores).!!!!!!"

Release Limitations exist on all levels. You would not want an Erlang VM to run with 10^5 schedulers.!!!!!!"

Release Push the responsibility for scalability from the programmer to the VM Analyze performance and scalability Identify bottlenecks and prioritize changes and extensions Tackle well-known scalability issues Ets tables (shared global data structure) Message passing, copying and frequently communicating processes

Discount Code: authd 50% off the Early Release 40% off the printed copy