SlideShare a Scribd company logo
Tutorial: Load testing
XMPP servers with Plain
Old Erlang
EUC 2015 tutorial, Stockholm
Paweł Pikuła
Who am I?
• Paweł Pikuła pawel.pikula@erlang-solutions.com
• Developer @ Erlang Solutions Ltd. Cracow office
• I work on MongooseIM XMPP server and some
IoT related project.
• github.com/ppikula
• twitter: @pawelpikula
Agenda
• What is load testing
• Introducing AMOC - our simple load testing tool
• Overview of our test infrastructure
• Breaking a single node
• Distributed scenario (scaling MIM and AMOC
horizontally)
• What to do next ?
Prepare the environment
• Install VirtualBox and Vagrant
• git clone https://github.com/ppikula/euc2015/
• Follow instructions from the README file (Setting
up the environment from a usb stick)
What is load testing ?
“In software engineering, performance testing is in
general testing performed to determine how a
system performs in terms of responsiveness and
stability under a particular workload. It can also
serve to investigate, measure, validate or verify
other quality attributes of the system, such as
scalability, reliability and resource usage.”
wikipedia
Why do we do load test ?
• Measure capacity of the whole system.
• Measure latencies, time to deliver and other quality
attributes.
• Find the bottlenecks in our system.
• Test a bad case scenarios under heavy load (ex. net splits,
overloaded DBs).
• Discover possible race conditions .
• Stress 3rd party software.
Types of tests - endurance
Types of traffic - stress
Types of traffic - spike
!
• Check if the system
can recover after the
spike
• How long does it take
to go back to the
normal state
TSUNG
• We‘ve been using it for a long time
• It does the job
• Tsung is dumb - doesn’t understand XMPP
• XML DSL …
• Manual setup
• It is not designed for bidirectional protocols
• HTTP semantics (request, transaction, page time)
• some strange race conditions? (I was never able to login 10K users every
time I tried I had ~9997 of them )
TSUNG DSL
OUR USE CASE
• stream management enabled (XEP 198) auto
respond to <r> with <a>
• authentication process requires acquiring a token
from http service
• carbon copies - multiple jabber resources
ESCALUS
• esl/ejabberd_tests use it for black box testing
• supports many transports (ws, bosh, tcp, tls)
• stanza generators
• built-in predicates (is_message, is_iq_result)
Escalus story
Can we use escalus ?
AMOC design goals
• Use the esl/escalus library
• Don’t reinvent the wheel - cooperate with graphite,
ansible, graphite notifications, graylog.
• Simple and practical
• No DSL - plain erlang
• build everything on one host
AMOC features
• Automatic deployment and environment setup via
ansible
• Exometer for collecting metrics - very easy to add a
new metric
• Uses modified erlang slave module
• Dynamically increase/decrease the amount of users
• Sends notifications about events mentioned above
Environment checklist
• File descriptors limit
• Check firewall rules
• TCP buffers and other options
• Increase local port range
• Create more network interfaces if you want to
generate more than 60K users
Why there is a limit of 60K
per interface?
• TCP port is a16 bit integer - we have only 65536
outgoing ports - reserved ones
AMOC Inside
!
• AMOC scenario - define init and start function
• AMOC controller - “user interface” start/stop
scenarios.
• The controller spawns users on AMOC slaves in
round robin fashion
SUT - MongooseIM
MongooseIM
• Fork of ejabberd 2.1.8
• Removed “non-scalable” extensions
• Added unit & integration tests (black box testing)
• Added many metrics
• Want to hear more? go to “MongooseIM - The Right
Tool for Scalable Messaging” by Michał Piotrowski
Task 1
break single box
Task 2
scale it !
Task3
Add custom metric to AMOC
• Message rate (spiral)
• Connected users count (counter)
• Time to deliver (histogram)
Future of AMOC
• automatic tests
• allow to pass inter arrival per scenario
• support for multiple scenarios
• ansible recipes for ubuntu/debian family
• dockerized version of AMOC?
• integration with elixir - that will allow us to create DSLs
Thanks !
Questions ?

More Related Content

PPTX
Introduction to stress test
KEY
Zero mq logs
PDF
How to stuff a 900 pound gorilla into a smartphone
PPTX
Tuenti Release Workflow
PDF
JS Fest 2019. Александр Хотемский. Способы распараллеливания тестов в JavaScript
PDF
JAZOON'13 - Nikita Salnikov-Tarnovski - Multiplatform Java application develo...
PPT
Comparative Performance of XSLT Processors in Apache Cocoon
PDF
Training Slides: 103 - Basics - Simple Tungsten Clustering Installation
Introduction to stress test
Zero mq logs
How to stuff a 900 pound gorilla into a smartphone
Tuenti Release Workflow
JS Fest 2019. Александр Хотемский. Способы распараллеливания тестов в JavaScript
JAZOON'13 - Nikita Salnikov-Tarnovski - Multiplatform Java application develo...
Comparative Performance of XSLT Processors in Apache Cocoon
Training Slides: 103 - Basics - Simple Tungsten Clustering Installation

What's hot (20)

PDF
Enterprise messaging
PPTX
WEPA - Webdriver Enhanced Platform for Automation - WEPATest
PDF
Event Driven Architectures with Camel
PPTX
Reactive Streams - László van den Hoek
PPTX
Rust kafka-5-2019-unskip
PDF
8th Athens Big Data Meetup - 1st Talk - Riding The Streaming Wave DIY Style
PDF
OSMC 2021 | Monitoring Open Source Hardware
PPT
ruby + websocket + haproxy
PDF
Integrating PostgreSql with RabbitMQ
PDF
Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...
PDF
OSMC 2021 | Robotmk: You don’t run IT – you deliver services!
PDF
Jakarta EE 8 on JDK17
PDF
Rust with-kafka-07-02-2019
PDF
All of the thing about Postman
PDF
jLove 2020 - Micronaut and graalvm: The power of AoT
PPTX
Reactive Micro Services with Java seminar
PDF
PostgreSQL: meet your queue
KEY
CPAN Gems From The Far East
PDF
[Draft] Fast Prototyping with DPDK and eBPF in Containernet
PPTX
Coroutines in Kotlin
Enterprise messaging
WEPA - Webdriver Enhanced Platform for Automation - WEPATest
Event Driven Architectures with Camel
Reactive Streams - László van den Hoek
Rust kafka-5-2019-unskip
8th Athens Big Data Meetup - 1st Talk - Riding The Streaming Wave DIY Style
OSMC 2021 | Monitoring Open Source Hardware
ruby + websocket + haproxy
Integrating PostgreSql with RabbitMQ
Building a company-wide data pipeline on Apache Kafka - engineering for 150 b...
OSMC 2021 | Robotmk: You don’t run IT – you deliver services!
Jakarta EE 8 on JDK17
Rust with-kafka-07-02-2019
All of the thing about Postman
jLove 2020 - Micronaut and graalvm: The power of AoT
Reactive Micro Services with Java seminar
PostgreSQL: meet your queue
CPAN Gems From The Far East
[Draft] Fast Prototyping with DPDK and eBPF in Containernet
Coroutines in Kotlin
Ad

Similar to EUC2015 - Load testing XMPP servers with Plain Old Erlang (20)

KEY
Real time system_performance_mon
PPTX
Fastest Servlets in the West
PPTX
Stream Computing (The Engineer's Perspective)
PDF
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
PDF
Jolt: Distributed, fault-tolerant test running at scale using Mesos
KEY
Messaging, interoperability and log aggregation - a new framework
KEY
Cooking a rabbit pie
PPTX
Using Apache Camel as AKKA
PDF
Machine Learning With H2O vs SparkML
PPTX
Performance Benchmarking: Tips, Tricks, and Lessons Learned
KEY
The Why and How of Scala at Twitter
PPTX
Hot to build continuously processing for 24/7 real-time data streaming platform?
PPTX
Sanger, upcoming Openstack for Bio-informaticians
PPTX
Flexible compute
PDF
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
PDF
Tools. Techniques. Trouble?
PDF
Agile Lab_BigData_Meetup_AKKA
PPTX
Kubernetes at NU.nl (Kubernetes meetup 2019-09-05)
PDF
Олександр Хотемський:”Serverless архітектура та її застосування в автоматизац...
PDF
Oleksandr Khotemskyi - Serverless architecture and how to apply it in Automa...
Real time system_performance_mon
Fastest Servlets in the West
Stream Computing (The Engineer's Perspective)
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Jolt: Distributed, fault-tolerant test running at scale using Mesos
Messaging, interoperability and log aggregation - a new framework
Cooking a rabbit pie
Using Apache Camel as AKKA
Machine Learning With H2O vs SparkML
Performance Benchmarking: Tips, Tricks, and Lessons Learned
The Why and How of Scala at Twitter
Hot to build continuously processing for 24/7 real-time data streaming platform?
Sanger, upcoming Openstack for Bio-informaticians
Flexible compute
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
Tools. Techniques. Trouble?
Agile Lab_BigData_Meetup_AKKA
Kubernetes at NU.nl (Kubernetes meetup 2019-09-05)
Олександр Хотемський:”Serverless архітектура та її застосування в автоматизац...
Oleksandr Khotemskyi - Serverless architecture and how to apply it in Automa...
Ad

Recently uploaded (20)

PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
medical staffing services at VALiNTRY
PDF
System and Network Administration Chapter 2
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
System and Network Administraation Chapter 3
PPTX
L1 - Introduction to python Backend.pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Essential Infomation Tech presentation.pptx
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Transform Your Business with a Software ERP System
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Reimagine Home Health with the Power of Agentic AI​
medical staffing services at VALiNTRY
System and Network Administration Chapter 2
Understanding Forklifts - TECH EHS Solution
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
System and Network Administraation Chapter 3
L1 - Introduction to python Backend.pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Odoo POS Development Services by CandidRoot Solutions
Upgrade and Innovation Strategies for SAP ERP Customers
2025 Textile ERP Trends: SAP, Odoo & Oracle
CHAPTER 2 - PM Management and IT Context
Essential Infomation Tech presentation.pptx
Navsoft: AI-Powered Business Solutions & Custom Software Development
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Transform Your Business with a Software ERP System

EUC2015 - Load testing XMPP servers with Plain Old Erlang

  • 1. Tutorial: Load testing XMPP servers with Plain Old Erlang EUC 2015 tutorial, Stockholm Paweł Pikuła
  • 2. Who am I? • Paweł Pikuła pawel.pikula@erlang-solutions.com • Developer @ Erlang Solutions Ltd. Cracow office • I work on MongooseIM XMPP server and some IoT related project. • github.com/ppikula • twitter: @pawelpikula
  • 3. Agenda • What is load testing • Introducing AMOC - our simple load testing tool • Overview of our test infrastructure • Breaking a single node • Distributed scenario (scaling MIM and AMOC horizontally) • What to do next ?
  • 4. Prepare the environment • Install VirtualBox and Vagrant • git clone https://github.com/ppikula/euc2015/ • Follow instructions from the README file (Setting up the environment from a usb stick)
  • 5. What is load testing ? “In software engineering, performance testing is in general testing performed to determine how a system performs in terms of responsiveness and stability under a particular workload. It can also serve to investigate, measure, validate or verify other quality attributes of the system, such as scalability, reliability and resource usage.” wikipedia
  • 6. Why do we do load test ? • Measure capacity of the whole system. • Measure latencies, time to deliver and other quality attributes. • Find the bottlenecks in our system. • Test a bad case scenarios under heavy load (ex. net splits, overloaded DBs). • Discover possible race conditions . • Stress 3rd party software.
  • 7. Types of tests - endurance
  • 8. Types of traffic - stress
  • 9. Types of traffic - spike ! • Check if the system can recover after the spike • How long does it take to go back to the normal state
  • 10. TSUNG • We‘ve been using it for a long time • It does the job • Tsung is dumb - doesn’t understand XMPP • XML DSL … • Manual setup • It is not designed for bidirectional protocols • HTTP semantics (request, transaction, page time) • some strange race conditions? (I was never able to login 10K users every time I tried I had ~9997 of them )
  • 12. OUR USE CASE • stream management enabled (XEP 198) auto respond to <r> with <a> • authentication process requires acquiring a token from http service • carbon copies - multiple jabber resources
  • 13. ESCALUS • esl/ejabberd_tests use it for black box testing • supports many transports (ws, bosh, tcp, tls) • stanza generators • built-in predicates (is_message, is_iq_result)
  • 15. Can we use escalus ?
  • 16. AMOC design goals • Use the esl/escalus library • Don’t reinvent the wheel - cooperate with graphite, ansible, graphite notifications, graylog. • Simple and practical • No DSL - plain erlang • build everything on one host
  • 17. AMOC features • Automatic deployment and environment setup via ansible • Exometer for collecting metrics - very easy to add a new metric • Uses modified erlang slave module • Dynamically increase/decrease the amount of users • Sends notifications about events mentioned above
  • 18. Environment checklist • File descriptors limit • Check firewall rules • TCP buffers and other options • Increase local port range • Create more network interfaces if you want to generate more than 60K users
  • 19. Why there is a limit of 60K per interface? • TCP port is a16 bit integer - we have only 65536 outgoing ports - reserved ones
  • 20. AMOC Inside ! • AMOC scenario - define init and start function • AMOC controller - “user interface” start/stop scenarios. • The controller spawns users on AMOC slaves in round robin fashion
  • 22. MongooseIM • Fork of ejabberd 2.1.8 • Removed “non-scalable” extensions • Added unit & integration tests (black box testing) • Added many metrics • Want to hear more? go to “MongooseIM - The Right Tool for Scalable Messaging” by Michał Piotrowski
  • 25. Task3 Add custom metric to AMOC • Message rate (spiral) • Connected users count (counter) • Time to deliver (histogram)
  • 26. Future of AMOC • automatic tests • allow to pass inter arrival per scenario • support for multiple scenarios • ansible recipes for ubuntu/debian family • dockerized version of AMOC? • integration with elixir - that will allow us to create DSLs