Scala + Akka + ning/async-http-client - Vancouver Scala meetup February 2015
Scala + Akka
+
ning/async-http-client
Or: How I stopped worrying about network
latency and drank the reactive cool-aid
Intro
$ whoami
RSS is dead, long live RSS!
● In constant decline over the years as
consumer-facing tech
● Still very popular between “content services”
● RSS/Atom feeds @ HS
o Follow feeds on behalf of users
o Post to social networks based on content
o ~250K active feeds, ~400K messages daily
Scaling webfeeds using PHP
But latency isn’t the problem; blocking is.
Enter Scala + Akka + async HTTP client
Akka: a short detour for the uninitiated
“Toolkit and runtime for building highly
concurrent, distributed, and fault tolerant
applications on the JVM”
● Implementation of the Actor model
● Scala, Java
● Adheres strictly to the Reactive Manifesto:
o Responsive, Resilient, Elastic, Message-driven
Akka (continued)
Source: http://www.scottlogic.com/blog/rdoyle/assets/ActorModel.png
Ning’s async-http-client
… in an actor
Actors in Scala webfeed service
So, what did this buy us?
Now
BeforeBefore ● 120 processes
● 6 X m3.xlarge
● 2 processes
● 2 X m3.xlarge
90 webfeed/sec 300 webfeed/sec
CPU utilization & load average - barely breaking a sweat!
Some lessons learned
● You can't ignore back pressure
o Pull-based approach
o Akka Streams to the rescue?
● scala.xml.pull.XMLEventReader is not
production ready
● Be weary of the resulting load on the rest of
your infrastructure!
Some lessons learned (continued)
● Actors should only ever do one thing (and do
it well)
o Easy to modify the actor topology (and it will
happen!)
o Easier to describe supervisor’s responsibilities
● Let it crash!
Thanks!
http://akka.io/
https://github.com/AsyncHttpClient/async-http-client
We’re hiring!
https://hootsuite.com/about/careers
yanik.berube@hootsuite.com
@yanik_berube

More Related Content

PPTX
Signal r azurepresentation
PPTX
AWS Serverless solution for developers
PPTX
Angular Owin Katana TypeScript
PDF
Connecting Akka with Oracle Event Hub Cloud Service
PDF
What is Node and Why does it Matter?
PDF
Webinar Alpakka 2018-08-16
PPTX
Site reliability in the serverless age - Serverless Boston Meetup
PPT
Real World Rails Deployment
Signal r azurepresentation
AWS Serverless solution for developers
Angular Owin Katana TypeScript
Connecting Akka with Oracle Event Hub Cloud Service
What is Node and Why does it Matter?
Webinar Alpakka 2018-08-16
Site reliability in the serverless age - Serverless Boston Meetup
Real World Rails Deployment

What's hot (20)

PPTX
Ops, DevOps, NoOps and AWS Lambda
PDF
Beyond Apache: Faster Web Servers
PDF
Building a Modern Microservices Architecture at Gilt: The Essentials
PPTX
Azure Microservices in Practice, Radu Vunvulea, ITCamp 2016
PDF
NDev Talk - Serverless Design Patterns
PPTX
AWS Meetup - Nordstrom Data Lab and the AWS Cloud
PPTX
Site speed Server Optimization
PDF
Developing Resilient Cloud Native Apps with Spring Cloud
PDF
Intro to OpenStack - Scott Sanchez and Niki Acosta
PDF
Serverless Systems: The Future is Here
PPTX
Owin & katana
PPT
Nordstrom Data Lab Recommendo API with Node.js
PPTX
Azure Microservices in Practice - Radu Vunvulea ITCamp Community Timisoara 07...
PDF
User-percieved performance
PPTX
SignalR with ASP.NET MVC 6
PPTX
Conf 2018 Track 2 - Custom Web Elements with Stencil
PPTX
Microservices Journey Summer 2017
PDF
The Hardest Part of Microservices: Your Data - Christian Posta, Red Hat
PDF
Serverless integration zero code
PDF
Denver AWS Users' Group Meeting - July 2018 Slides
Ops, DevOps, NoOps and AWS Lambda
Beyond Apache: Faster Web Servers
Building a Modern Microservices Architecture at Gilt: The Essentials
Azure Microservices in Practice, Radu Vunvulea, ITCamp 2016
NDev Talk - Serverless Design Patterns
AWS Meetup - Nordstrom Data Lab and the AWS Cloud
Site speed Server Optimization
Developing Resilient Cloud Native Apps with Spring Cloud
Intro to OpenStack - Scott Sanchez and Niki Acosta
Serverless Systems: The Future is Here
Owin & katana
Nordstrom Data Lab Recommendo API with Node.js
Azure Microservices in Practice - Radu Vunvulea ITCamp Community Timisoara 07...
User-percieved performance
SignalR with ASP.NET MVC 6
Conf 2018 Track 2 - Custom Web Elements with Stencil
Microservices Journey Summer 2017
The Hardest Part of Microservices: Your Data - Christian Posta, Red Hat
Serverless integration zero code
Denver AWS Users' Group Meeting - July 2018 Slides
Ad

Viewers also liked (20)

PPT
Logging with Logback in Scala
PDF
scalaphx-akka-http
PDF
Akka persistence webinar
PDF
Codemotion akka persistence, cqrs%2 fes y otras siglas del montón
ODP
Akka Persistence | Event Sourcing
ODP
Reactive programming with scala and akka
PDF
Akka Streams
PDF
Event Sourcing using Akka on AWS
PPTX
Akka-http
PPTX
CQRS+ESをAkka Persistenceを使って実装してみる。
PPTX
JavaOne: A tour of (advanced) akka features in 60 minutes [con1706]
PDF
Akka Http , Routes, Streams with Scala
PDF
DDDing Tools = Akka Persistence
PDF
The Cloud-natives are RESTless @ JavaOne
PDF
Akka http 2
ODP
Akka http
PDF
Akka Persistence and Eventuate
KEY
spray: REST on Akka (Scala Days)
PDF
Reactive Streams / Akka Streams - GeeCON Prague 2014
KEY
Introduction to Actor Model and Akka
Logging with Logback in Scala
scalaphx-akka-http
Akka persistence webinar
Codemotion akka persistence, cqrs%2 fes y otras siglas del montón
Akka Persistence | Event Sourcing
Reactive programming with scala and akka
Akka Streams
Event Sourcing using Akka on AWS
Akka-http
CQRS+ESをAkka Persistenceを使って実装してみる。
JavaOne: A tour of (advanced) akka features in 60 minutes [con1706]
Akka Http , Routes, Streams with Scala
DDDing Tools = Akka Persistence
The Cloud-natives are RESTless @ JavaOne
Akka http 2
Akka http
Akka Persistence and Eventuate
spray: REST on Akka (Scala Days)
Reactive Streams / Akka Streams - GeeCON Prague 2014
Introduction to Actor Model and Akka
Ad

Similar to Scala + Akka + ning/async-http-client - Vancouver Scala meetup February 2015 (20)

PDF
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
PDF
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
PDF
End to End Akka Streams / Reactive Streams - from Business to Socket
PDF
Not Only Streams for Akademia JLabs
PDF
How Reactive Streams & Akka Streams change the JVM Ecosystem
PDF
Scala usergroup stockholm - reactive integrations with akka streams
PDF
Pakk Your Alpakka: Reactive Streams Integrations For AWS, Azure, & Google Cloud
PDF
Reactive database access with Slick3
PDF
Akka Streams in Action @ ScalaDays Berlin 2016
PPTX
Understanding Akka WebSockets A Comprehensive Guide.pptx
PPTX
Understanding Akka WebSockets A Comprehensive Guide
PDF
AWS Re-Invent 2017 Netflix Keystone SPaaS - Monal Daxini - Abd320 2017
PPTX
Reactive Streams - László van den Hoek
PDF
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
PDF
Reactive Stream Processing with Akka Streams
PDF
HTTP Plugin for MySQL!
PDF
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
PDF
Reactive Streams, j.u.concurrent, & Beyond!
PPTX
Kafka Streams for Java enthusiasts
PDF
Building REST API using Akka HTTP with Scala
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
End to End Akka Streams / Reactive Streams - from Business to Socket
Not Only Streams for Akademia JLabs
How Reactive Streams & Akka Streams change the JVM Ecosystem
Scala usergroup stockholm - reactive integrations with akka streams
Pakk Your Alpakka: Reactive Streams Integrations For AWS, Azure, & Google Cloud
Reactive database access with Slick3
Akka Streams in Action @ ScalaDays Berlin 2016
Understanding Akka WebSockets A Comprehensive Guide.pptx
Understanding Akka WebSockets A Comprehensive Guide
AWS Re-Invent 2017 Netflix Keystone SPaaS - Monal Daxini - Abd320 2017
Reactive Streams - László van den Hoek
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
Reactive Stream Processing with Akka Streams
HTTP Plugin for MySQL!
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Reactive Streams, j.u.concurrent, & Beyond!
Kafka Streams for Java enthusiasts
Building REST API using Akka HTTP with Scala

Recently uploaded (20)

PPTX
4Seller: The All-in-One Multi-Channel E-Commerce Management Platform for Glob...
PDF
Website Design & Development_ Professional Web Design Services.pdf
PPTX
Computer Software - Technology and Livelihood Education
PDF
Practical Indispensable Project Management Tips for Delivering Successful Exp...
PPT
3.Software Design for software engineering
PPTX
ROI from Efficient Content & Campaign Management in the Digital Media Industry
PPTX
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
PPTX
Chapter 1 - Transaction Processing and Mgt.pptx
PDF
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
PPTX
Bandicam Screen Recorder 8.2.1 Build 2529 Crack
PDF
Microsoft Office 365 Crack Download Free
PDF
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
PPTX
Viber For Windows 25.7.1 Crack + Serial Keygen
PDF
CCleaner 6.39.11548 Crack 2025 License Key
PPTX
MLforCyber_MLDataSetsandFeatures_Presentation.pptx
PDF
AI Guide for Business Growth - Arna Softech
PPTX
DevOpsDays Halifax 2025 - Building 10x Organizations Using Modern Productivit...
DOC
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
PPTX
ROI Analysis for Newspaper Industry with Odoo ERP
PPTX
Python is a high-level, interpreted programming language
4Seller: The All-in-One Multi-Channel E-Commerce Management Platform for Glob...
Website Design & Development_ Professional Web Design Services.pdf
Computer Software - Technology and Livelihood Education
Practical Indispensable Project Management Tips for Delivering Successful Exp...
3.Software Design for software engineering
ROI from Efficient Content & Campaign Management in the Digital Media Industry
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
Chapter 1 - Transaction Processing and Mgt.pptx
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
Bandicam Screen Recorder 8.2.1 Build 2529 Crack
Microsoft Office 365 Crack Download Free
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
Viber For Windows 25.7.1 Crack + Serial Keygen
CCleaner 6.39.11548 Crack 2025 License Key
MLforCyber_MLDataSetsandFeatures_Presentation.pptx
AI Guide for Business Growth - Arna Softech
DevOpsDays Halifax 2025 - Building 10x Organizations Using Modern Productivit...
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
ROI Analysis for Newspaper Industry with Odoo ERP
Python is a high-level, interpreted programming language

Scala + Akka + ning/async-http-client - Vancouver Scala meetup February 2015

Editor's Notes

  • #3: TODO: add owly loves scala pic
  • #4: -Who I am -What does Hootsuite do -What the Publishing team does -Mention move to service-oriented/microservices architecture -Scala+Akka at Hootsuite (not sure I need some slides for this material)
  • #5: -So, what am I going to talk about? RSS/Atom feeds? -XML? Is this guy for real? -Constant decline over the years as consumer-facing technology (graph) -But still used a great deal between "content services" -How are RSS/Atom feeds used at Hootsuite? -Webfeeds at Hootsuite; how much?
  • #6: -Show a rough sketch of php+gearman+cron -Latency, latency, latency everywhere!
  • #7: Talk about the example of mailing a letter or getting your car/bike fixed Waiting around for something that someone else is doing to be finished is simply wasteful.
  • #10: actors (encapsulate state and behaviour - true encapsulation) mailboxes immutable messages supervisory hierarchy concurrency and distribution is handled by the framework
  • #11: Ning’s async-http-client -library written in Java but some Scala wrappers exist -we use Play’s wrapper for convenience but access the underlying ning client for greater control of the configuration -easy to configure -returns a Future to map, compose, etc. (a familiar construct to Scala hackers)
  • #12: Common pattern for handling futures in Akka actors.
  • #15: -Graphs show rough representation of throughput in # of message sent by units of time -Greater throughput with less computational capacity
  • #16: -Number of webfeeds processed per second. -This is after throttling the service because of the pressure it imposed on other parts of the system