SlideShare a Scribd company logo
Deploying Akka in
Production
Do’s and Don’ts when
Mike Nash
Introduction
We’ve deployed dozens of Akka-based services and apps
to production in the past 5 years
We’ve scaled up to tens of millions of events per hour, day
after day
Our team has learned where the potholes are
Architecting for
Performance
Going reactive before the first line of code is written
Code Quality and Architecture
Quality = lower cost of future changes
Correct architecture = longevity, e.g
the system lives on even if parts are
replaced in flight
Many small pieces usually work
better than a few big ones
Find out about Ports and Adapters/
Onion Architecture: Keep domain and
infrastructure distinct
Delivery Guarantees
Understand what guarantees Akka
provides - and what it doesn’t
The best design is often the one that
doesn’t need many guarantees
Most “guarantees” are imaginary in
any case
Single Points of Contention
Database?
Blocking Operations
Look for blocking operations
Immutability
Encapsulate state in Actors (or Agents)
Messages must be immutable
Keep it Simple
Just because you can doesn’t mean you should
Simple, independent pieces are best
Keep your code out of other people’s databases
Distinguish between Commands and Events
Think about back-pressure
Think about back pressure: Look for any
situations where mailboxes might be
allowed to grow without limits
Slow producer is not a big problem
Slow consumer can be a big problem
Akka streams
Think about dispatchers and routers: The
defaults are not always what you want.
Serialization
Think about for remote actors
Default requires some class path
magic
Choices include text, json, protobuf,
many others, all with tradeoffs
Benchmark your serializer/
deserializer!
Actor? Future? Agent?
Actors encapsulate State or Behaviour, they have a
mailbox and a name
Futures contain and retrieve the result of a concurrent
operation
Agents encapsulate a value (at a single location) -
immediate read, async writes
Testing
Common performance blockers under heavy load
Testing
Beyond the Obvious
Unit and Functional are the
Foundation
Akka TestKit: Test actors as if they
were synchronous
“Negative” tests are essential
Do's and don'ts when deploying akka in production
JVM Tuning
Memory
You need more than you think you need
Know your Garbage Collectors
Must run under load to see
characteristics
Defaults are probably not what you
want
Takes more memory to free up more
memory…
-verbosegc is your friend
Production Deployments
Tips for a rock-solid deployment pipeline
Deployment Pipeline
Not just about getting to production
How will you deploy new versions
without downtime?
How will you revert if you have to?
It’s 2 am - Do you know where your
dependencies are?
Deployment Packaging
How will you get your app to
production? Onejar?
In our experience, external
containers are not helpful
How will you tell if its the right
version and revision?
Rolling Restarts?
Dependencies
Your application or service sits atop
a tall stack of dependencies
Is the stack in the same order on
production?
Is it the same stack?
Configuration
Akka’s configuration works great -
don’t fix it!
Discovery beats hard-wiring
Procrastinate
Monitoring
Beyond Testing
Monit
More than monitoring
Statsd, Graphite
Custom timing and counts
Kamon
Specifically for Reactive Applications
What happens when….?
Boundary Conditions
Logging
Related to monitoring, but very different
Surprisingly expensive - consider async, macros (like
ScalaLogging) to omit when level disabled
Line numbers are *very* expensive, check your
formats
Log rolling strategy is critical
Consider Graylog or similar to view logs across
multiple nodes, filter, route and alert on log contents
Consider ssh server or remote message to change log
level on the fly for a running system
Logback’s Mapped Diagnostic Context can be handy
Security
Beyond the usual security concerns
any application has
How will you prevent “fake”
messages from being handled?
There is such a thing as too much of a
good thing
Summary
Do's and don'ts when deploying akka in production

More Related Content

PPTX
Akka 2.4 plus new commercial features in Typesafe Reactive Platform
PDF
Streaming Big Data with Spark, Kafka, Cassandra, Akka & Scala (from webinar)
PPTX
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
PDF
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
PDF
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
PDF
How to deploy Apache Spark 
to Mesos/DCOS
PPTX
Typesafe Reactive Platform: Monitoring 1.0, Commercial features and more
PDF
Akka Cluster in Production
Akka 2.4 plus new commercial features in Typesafe Reactive Platform
Streaming Big Data with Spark, Kafka, Cassandra, Akka & Scala (from webinar)
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
How to deploy Apache Spark 
to Mesos/DCOS
Typesafe Reactive Platform: Monitoring 1.0, Commercial features and more
Akka Cluster in Production

What's hot (20)

PDF
Real-time personal trainer on the SMACK stack
PDF
A Tale of Two APIs: Using Spark Streaming In Production
PDF
Akka, Spark or Kafka? Selecting The Right Streaming Engine For the Job
PDF
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
PDF
Using Spark, Kafka, Cassandra and Akka on Mesos for Real-Time Personalization
PDF
Streaming Microservices With Akka Streams And Kafka Streams
PDF
Making Scala Faster: 3 Expert Tips For Busy Development Teams
PDF
A Journey to Reactive Function Programming
PDF
Moving from Big Data to Fast Data? Here's How To Pick The Right Streaming Engine
PDF
Akka at Enterprise Scale: Performance Tuning Distributed Applications
PDF
Akka Streams And Kafka Streams: Where Microservices Meet Fast Data
PDF
101 ways to configure kafka - badly (Kafka Summit)
PDF
Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...
PDF
Kafka and Spark Streaming
PDF
Lambda Architecture with Spark Streaming, Kafka, Cassandra, Akka, Scala
PPTX
Apache Kafka 0.8 basic training - Verisign
PPTX
Service Stampede: Surviving a Thousand Services
PDF
Akka and Kubernetes: Reactive From Code To Cloud
PPTX
Kafka On YARN (KOYA): An Open Source Initiative to integrate Kafka & YARN
PDF
What's new in Confluent 3.2 and Apache Kafka 0.10.2
Real-time personal trainer on the SMACK stack
A Tale of Two APIs: Using Spark Streaming In Production
Akka, Spark or Kafka? Selecting The Right Streaming Engine For the Job
Akka Revealed: A JVM Architect's Journey From Resilient Actors To Scalable Cl...
Using Spark, Kafka, Cassandra and Akka on Mesos for Real-Time Personalization
Streaming Microservices With Akka Streams And Kafka Streams
Making Scala Faster: 3 Expert Tips For Busy Development Teams
A Journey to Reactive Function Programming
Moving from Big Data to Fast Data? Here's How To Pick The Right Streaming Engine
Akka at Enterprise Scale: Performance Tuning Distributed Applications
Akka Streams And Kafka Streams: Where Microservices Meet Fast Data
101 ways to configure kafka - badly (Kafka Summit)
Akka A to Z: A Guide To The Industry’s Best Toolkit for Fast Data and Microse...
Kafka and Spark Streaming
Lambda Architecture with Spark Streaming, Kafka, Cassandra, Akka, Scala
Apache Kafka 0.8 basic training - Verisign
Service Stampede: Surviving a Thousand Services
Akka and Kubernetes: Reactive From Code To Cloud
Kafka On YARN (KOYA): An Open Source Initiative to integrate Kafka & YARN
What's new in Confluent 3.2 and Apache Kafka 0.10.2
Ad

Similar to Do's and don'ts when deploying akka in production (20)

PDF
Akka in Action 1st Edition Raymond Roestenburg download pdf
PDF
[PDF Download] Akka in Action 1st Edition Raymond Roestenburg fulll chapter
PPTX
Akka for big data developers
PDF
Akka in Production - ScalaDays 2015
PDF
Reactive applications with Akka.Net - DDD East Anglia 2015
ODP
Reactive programming with scala and akka
PDF
What to Expect When You're Expecting (to Own Production)
PDF
Building Stateful Microservices With Akka
PPT
Akka.Net & .Net Core - .Net Inside 4° MeetUp
PDF
12 Factor Scala
PPTX
Akka-demy (a.k.a. How to build stateful distributed systems) II/II
PDF
Real World Android Akka
ODP
Real-world Experiences in Scala
PDF
Akka java
PDF
Agile Lab_BigData_Meetup_AKKA
PPTX
How to scale your applications ? - #bzhcamp
PDF
Build Cloud Applications with Akka and Heroku
PDF
Actor-based concurrency in a modern Java Enterprise
PDF
Building applications with akka.net
PDF
Reactive programming with akka
Akka in Action 1st Edition Raymond Roestenburg download pdf
[PDF Download] Akka in Action 1st Edition Raymond Roestenburg fulll chapter
Akka for big data developers
Akka in Production - ScalaDays 2015
Reactive applications with Akka.Net - DDD East Anglia 2015
Reactive programming with scala and akka
What to Expect When You're Expecting (to Own Production)
Building Stateful Microservices With Akka
Akka.Net & .Net Core - .Net Inside 4° MeetUp
12 Factor Scala
Akka-demy (a.k.a. How to build stateful distributed systems) II/II
Real World Android Akka
Real-world Experiences in Scala
Akka java
Agile Lab_BigData_Meetup_AKKA
How to scale your applications ? - #bzhcamp
Build Cloud Applications with Akka and Heroku
Actor-based concurrency in a modern Java Enterprise
Building applications with akka.net
Reactive programming with akka
Ad

Recently uploaded (20)

PDF
System and Network Administraation Chapter 3
PPTX
Materi_Pemrograman_Komputer-Looping.pptx
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
System and Network Administration Chapter 2
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
history of c programming in notes for students .pptx
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
AI in Product Development-omnex systems
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
PTS Company Brochure 2025 (1).pdf.......
DOCX
The Five Best AI Cover Tools in 2025.docx
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Transform Your Business with a Software ERP System
System and Network Administraation Chapter 3
Materi_Pemrograman_Komputer-Looping.pptx
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
System and Network Administration Chapter 2
Adobe Illustrator 28.6 Crack My Vision of Vector Design
history of c programming in notes for students .pptx
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Understanding Forklifts - TECH EHS Solution
Upgrade and Innovation Strategies for SAP ERP Customers
AI in Product Development-omnex systems
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PTS Company Brochure 2025 (1).pdf.......
The Five Best AI Cover Tools in 2025.docx
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Operating system designcfffgfgggggggvggggggggg
Design an Analysis of Algorithms I-SECS-1021-03
Transform Your Business with a Software ERP System

Do's and don'ts when deploying akka in production