SlideShare a Scribd company logo
ARC303 - Unmeltable Infrastructure at Scale:
Using Apache Kafka, Twitter Storm
and ElasticSearch on AWS
Jim Nisbet

Philip O’Toole

CTO and VP of Engineering, Loggly

Lead Developer, Infrastructure, Loggly

November 2013

© 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.
What Loggly Does
•  Log Management as a service
–  Near real-time indexing of events

•  Distributed architecture, built on AWS
•  Initial production services in 2011
–  Loggly Generation 2 released in Sept 2013

•  Thousands of customers
Agenda for this Presentation
• 
• 
• 
• 
• 
• 

A bit about logging
Lessons learned from our first generation
How we leverage AWS services
Our use of Kafka, Storm, ElasticSearch
What worked well for us and what did not
Where we are going
Log Management
•  Everyone starts with …
–  A bunch of log files (syslog, application specific)
–  On a bunch of machines

•  Management consists of doing the simple stuff
–  Rotate files, compress and delete
–  Information is there but awkward to find specific events
–  Weird log retention policies evolve over time
“…how can I make this someone else’s problem!”

“…hmmm, our logs are getting a bit bloated”

Log Volume

Self-Inflicted Pain

“…let’s spend time managing our log capacity”
Best Practices in Log Management
•  Use existing logging infrastructure
–  Real time syslog forwarding is built in
–  Application log file watching

•  Store logs externally
–  Accessible when there is a system failure

•  Log messages in machine parsable format
–  JSON encoding when logging structured information
–  Key-value pairs
From the Trenches…
•  Managing Applications vs. Managing Logs
–  Do not make this is an either/or proposition!

If you get a disk space alert, first login…
% sudo rm –rf /var/log/apache2/*!

Admit it, we’ve all seen this kind of thing!
You Have Logs...
2013-10-25T18:35:43.387+0000: 441.482: [GC [PSYoungGen: 2430541K->268617K(2484544K)] 7687523K>5660738K(8076992K), 0.3266870 secs] [Times: user=1.05 sys=0.17, real=0.33 secs]!
2013-10-25T18:35:43.714+0000: 441.809: [Full GC [PSYoungGen: 268617K->0K(2484544K)] [ParOldGen: 5392121K>354965K(5592448K)] 5660738K->354965K(8076992K) [PSPermGen: 44444K->44395K(83968K)], 0.9225290 secs] [Times:
user=2.22 sys=0.26, real=0.92 secs]!

•  In this case, JVM garbage collection logs
enabled with…
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps
Yes, you need to search these logs
But you also need to to spot trends
Loggly Offers Logging as a Service
Loggly First Generation
•  Logging as a service
–  Real-time searchable logs

•  Thousands of customers
–  Transmission rates from 10 events/sec to 100k events/sec
–  When customers systems are busy they send more logs
–  Log traffic has distinct bursts; bursts can last for several hours

•  AWS EC2 deployment
–  We used EC2 Instance storage

•  SOLR Cloud
–  Full power of Lucene search
–  Tens of thousands of shards (with special ‘sleep shard’ logic)

•  ZeroMQ for message queue
First Generation Lessons Learned
•  Event ingestion too tightly coupled to indexing
–  Manual re-indexing for temporary SOLR issues

•  Multiple Indexing strategies needed
–  4 orders of magnitude difference between our high volume users
and our low volume users (10 eps vs. 100,000+ eps)
–  Too much system overhead for low volume users
–  Difficult to support changing sharding strategies for a customer
Big Data Infrastructure Solutions
We are not alone…
•  Our challenges
– 
– 
– 
– 
– 

Massive incoming event stream
Fundamentally multi-tenant
Scalable framework for analysis
Near real-time indexing
Time series index management

Scalability

Real
Time

Analytics

Multi
tenant

SaaS
Apache Kafka
•  Overview
– 
– 
– 
– 

An Apache project initially developed at LinkedIn
Distributed publish-subscribe messaging system
Specifically designed for real time activity streams
Does not follow JMS Standards nor uses JMS APIs

•  Key Features
– 
– 
– 
– 

Persistent messaging
High throughput
Uses Zookeeper for forming a cluster of nodes
Supports both queue and topic semantics
Message Queue Performance

http://research.microsoft.com/en-us/um/people/srikanth/netdb11/netdb11papers/netdb11-final12.pdf
Storm Framework
•  Storm (open sourced by Twitter)
–  Open sourced September 2011
–  Now an Apache Software Foundation project
•  Currently Incubator Status

•  Framework is for stream processing
– 
– 
– 
– 

Distributed
Fault tolerant
Computation
Fail-fast components
Storm Logical View
Example Topology
Bolt
Spout

Bolt
Bolt

Spouts emit source stream

Bolts perform stream processing

Bolt
Storm Physical View
ElasticSearch
•  Open source
–  Commercial support available from ElasticSearch.com
–  Growing open-source community

• 
• 
• 
• 
• 

Distributed search engine
Fully exposes Lucene search functionality
Built for clustering from the ground-up
High availability
Multi-tenancy
ElasticSearch In Action
•  Add/delete nodes dynamically
•  Add indexes with REST api
•  Indexes and Nodes have attributes
–  Indexes automatically moved to best Nodes

•  Indexes can be sharded
•  Supports bulk insertion of events
•  Plugins for monitoring cluster
Our Second Generation
Generation 2 – The Challenge
•  Always accept log data
–  Never make a customer’s incident worse

•  Never drop log data
–  A single log message could be critical

•  True Elasticity
Perfect Match For Real Time Log Events
•  Apache Kafka
–  Extremely high-performance pub-sub persistent queue

•  Consumer tracks their location in queue
–  A good fit for our use cases

•  Multiple Kafka brokers
–  Good match for AWS
•  Multiple brokers per region
•  Availability Zone separation
Real Time Event Processing
•  Twitter Storm
–  Scalable realtime computation sysytem

•  Storm used as a “pull” system
–  Provisioned for average load, not peak load
–  Input from Kafka queue
•  Worker nodes can be scaled dynamically

•  Elasticity is key
–  Another good match for AWS
•  Able to scale workers up and down dynamically
Log Event Ingestion
Kafka
Stage 2
Loggly Collector Performance
•  C++ multi-threaded
•  Boost ASIO framework
•  Each Collector can
handle 250k+ events
per second
–  Per m2.2xlarge instance

1 x EC2 m2.2xlarge Collector instance
(300 byte average event size).
Processing Events
Storm Event Processing

Identify
Customer

Summary
Statistics

Kafka
Stage 2

Acme
Bucket
Event Pipeline in Summary
•  Storm provides Complex Event Processing
–  Where we run much of our secret-sauce

•  Stage 1 contains the raw Events
•  Stage 2 contains processed Events
•  Snapshot the last day of Stage 2 events to S3
Elastic Search Clusters

Multi-Tiered
Elastic Cluster
Loggly and Index Management
•  Indexes are time-series data
–  Separated by customer
–  Represent slices of time
•  Higher volume index will have shorter time slice

•  Multi-tier architecture for efficient indexing
–  Multiple indexing tiers mapped to different AWS instance types

•  Efficient use of AWS resources
AWS Deployment Instances – Stage 1

c1.xlarge
• 
• 
• 

Compute-optimized
High-traffic ingestion points
Disk not important

m2.2xlarge!
• 
• 

Memory-optimized
Disk buffer caching

4K Provisioned IOPs EBS
• 
• 
• 

Ensures consistent IO
No noisy-neighbours
Persistent storage
AWS Deployment Instances – Stage 2

ZooKeeper

c1.xlarge

m1.xlarge

• 
• 

• 
• 
• 

• 

Compute-optimized
CPU-intensive
processing
Network IO

General-purpose
Configuration
Management

m2.2xlarge
• 
• 
• 

Memory-optimized
Disk buffer caching
4K provisioned IOPs EBS
AWS Deployment Instances – Indexing

cc2.8xlarge!
•  4K Provisioned IOPs EBS

m2.4xlarge!
•  4K Provisioned IOPs EBS
A Few False Starts
ELB in front of Collector Had Limitations
•  Initial testing used AWS Elastic Load Balancer for incoming
events:

•  ELB doesn’t allow forwarding port 514 (syslog)
•  ELB doesn’t support forwarding UDP
•  Event traffic can burst and hit ELB performance limits
AWS Route 53 DNS Round Robin a Win
•  DNS Round Robin is a pretty basic load balancing
–  Not a bump in the wire

•  Take advantage of AWS failover health checks
–  When a collector goes out of service, it will be out of the DNS rotation

•  Round Robin across multiple regions, AZs
–  Latency based resolution optimizes inbound traffic

•  Collector failover takes longer than it would with ELB
Our First Plan for Log Events
•  Cassandra
–  Highly scalable key-value store
–  Impressive write performance a good match for us
–  Apache project plus commercial support with DataStax

•  Use Cassandra for both our Event Queue and
Persistent Store
–  Our strategy was to get the raw event in to Cassandra
–  …then perform workflow processing on events
Design meets Reality
•  Cassandra not designed to be a message queue
•  Hard to track Events received out-of-order

•  Multi-tenancy requires handling data bursts
–  Collectors still needed to be able to buffer to disk
–  Added complexity and became a point of failure
Staging Pre-Production System
Load Balancing

Kafka
Stage 2
Kafka enables Staging Architecture
•  Kafka producer doesn’t care if there are
multiple consumers
•  Staging system runs pre-production code
•  Pub-sub allows us to randomly index a
fraction of our production load
•  A highly-effective pre-production system
AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly
Big Wins
•  Leveraging AWS services
– 
– 
– 
– 

Multi-Region, multi-AZ
Provisioned IOPS for availability and scale
Route 53 DNS support with latency resolution
Easy to increase and decrease Storm resources

•  Leveraging Open Source infrastructure
–  Apache Kafka
–  Twitter Storm
–  ElasticSearch

•  Staging
Future of Loggly Infrastructure
•  Better use of Amazon Auto Scaling
•  Keep logs in region they came from
–  We currently keep indexed events in a single region

•  Integrate with more external data sources
Feedback
•  Questions?
Send’em to us on twitter: @loggly
Kick the tires, sign up: loggly.com/ace
Jim Nisbet
CTO and VP of Engineering, Loggly
Philip O’Toole
Lead Developer, Infrastructure, Loggly

More Related Content

PDF
Why @Loggly Loves Apache Kafka, and How We Use Its Unbreakable Messaging for ...
PPTX
Netflix Data Pipeline With Kafka
PDF
Flink forward-2017-netflix keystones-paas
PDF
Data pipeline with kafka
PDF
Netflix Keystone Pipeline at Samza Meetup 10-13-2015
PDF
Netflix keystone streaming data pipeline @scale in the cloud-dbtb-2016
PDF
Unbounded bounded-data-strangeloop-2016-monal-daxini
PPTX
Netflix Data Pipeline With Kafka
Why @Loggly Loves Apache Kafka, and How We Use Its Unbreakable Messaging for ...
Netflix Data Pipeline With Kafka
Flink forward-2017-netflix keystones-paas
Data pipeline with kafka
Netflix Keystone Pipeline at Samza Meetup 10-13-2015
Netflix keystone streaming data pipeline @scale in the cloud-dbtb-2016
Unbounded bounded-data-strangeloop-2016-monal-daxini
Netflix Data Pipeline With Kafka

What's hot (20)

PPTX
Kafka - Linkedin's messaging backbone
PDF
The Netflix Way to deal with Big Data Problems
PPTX
Building an Event-oriented Data Platform with Kafka, Eric Sammer
PPTX
Streaming in Practice - Putting Apache Kafka in Production
PPTX
Building Event-Driven Systems with Apache Kafka
PDF
Beaming flink to the cloud @ netflix ff 2016-monal-daxini
PPTX
Introduction to Kafka
PDF
Akka, Spark or Kafka? Selecting The Right Streaming Engine For the Job
PDF
URP? Excuse You! The Three Metrics You Have to Know
PPTX
Running Kafka for Maximum Pain
PDF
Deploying Kafka at Dropbox, Mark Smith, Sean Fellows
PPTX
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
PPTX
Apache Pulsar: Why Unified Messaging and Streaming Is the Future - Pulsar Sum...
PPTX
Hive & HBase For Transaction Processing
PDF
Should you read Kafka as a stream or in batch? Should you even care? | Ido Na...
PPTX
6/18/14 Billing & Payments Engineering Meetup I
PPTX
Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails?
PPTX
Putting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OS
PPTX
Change Data Capture using Kafka
PPTX
Copy of Kafka-Camus
Kafka - Linkedin's messaging backbone
The Netflix Way to deal with Big Data Problems
Building an Event-oriented Data Platform with Kafka, Eric Sammer
Streaming in Practice - Putting Apache Kafka in Production
Building Event-Driven Systems with Apache Kafka
Beaming flink to the cloud @ netflix ff 2016-monal-daxini
Introduction to Kafka
Akka, Spark or Kafka? Selecting The Right Streaming Engine For the Job
URP? Excuse You! The Three Metrics You Have to Know
Running Kafka for Maximum Pain
Deploying Kafka at Dropbox, Mark Smith, Sean Fellows
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
Apache Pulsar: Why Unified Messaging and Streaming Is the Future - Pulsar Sum...
Hive & HBase For Transaction Processing
Should you read Kafka as a stream or in batch? Should you even care? | Ido Na...
6/18/14 Billing & Payments Engineering Meetup I
Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails?
Putting Kafka In Jail – Best Practices To Run Kafka On Kubernetes & DC/OS
Change Data Capture using Kafka
Copy of Kafka-Camus
Ad

Viewers also liked (13)

PDF
6 Critical SaaS Engineering Mistakes to Avoid
PDF
Rumble Entertainment GDC 2014: Maximizing Revenue Through Logging
DOC
Business company-profile-templatedocdoc765
PDF
Презентация IT компании. Презентация для сервисной компании.
PPTX
Itc Presentation
PPTX
New company presentation slideshare
PPS
Itc-company profile
PDF
Презентация бизнес-плана кафе
PDF
Шаблон презентации о Компании в PowerPoint (B2B)
PPT
Ppt of company profile in project
PPT
Tcs company profile presentation -sample
PDF
Introduction to SlideShare for Businesses
PPSX
Company Overview Presentation
6 Critical SaaS Engineering Mistakes to Avoid
Rumble Entertainment GDC 2014: Maximizing Revenue Through Logging
Business company-profile-templatedocdoc765
Презентация IT компании. Презентация для сервисной компании.
Itc Presentation
New company presentation slideshare
Itc-company profile
Презентация бизнес-плана кафе
Шаблон презентации о Компании в PowerPoint (B2B)
Ppt of company profile in project
Tcs company profile presentation -sample
Introduction to SlideShare for Businesses
Company Overview Presentation
Ad

Similar to AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly (20)

PPTX
Cloud Security Monitoring and Spark Analytics
PDF
Extending Spark Streaming to Support Complex Event Processing
PDF
Spark cep
PDF
John adams talk cloudy
PPTX
Scality S3 Server: Node js Meetup Presentation
PDF
Netflix Keystone—Cloud scale event processing pipeline
PPTX
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud
PPTX
Case Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
PDF
Stay productive_while_slicing_up_the_monolith
PPTX
ELK Ruminating on Logs (Zendcon 2016)
PPTX
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
PPTX
Centralized log-management-with-elastic-stack
PPTX
Sanger, upcoming Openstack for Bio-informaticians
PPTX
Flexible compute
PDF
Real Time Insights for Advertising Tech
PDF
Running Spark on Cloud
PDF
NetflixOSS Open House Lightning talks
PDF
Internals of Presto Service
PPTX
Tech4Africa 2014
PPTX
TenMax Data Pipeline Experience Sharing
Cloud Security Monitoring and Spark Analytics
Extending Spark Streaming to Support Complex Event Processing
Spark cep
John adams talk cloudy
Scality S3 Server: Node js Meetup Presentation
Netflix Keystone—Cloud scale event processing pipeline
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
Stay productive_while_slicing_up_the_monolith
ELK Ruminating on Logs (Zendcon 2016)
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
Centralized log-management-with-elastic-stack
Sanger, upcoming Openstack for Bio-informaticians
Flexible compute
Real Time Insights for Advertising Tech
Running Spark on Cloud
NetflixOSS Open House Lightning talks
Internals of Presto Service
Tech4Africa 2014
TenMax Data Pipeline Experience Sharing

More from SolarWinds Loggly (10)

PDF
Loggly - Tools and Techniques For Logging Microservices
PDF
Loggly - 5 Popular .NET Logging Libraries
PDF
Loggly - IT Operations in a Serverless World (Infographic)
PDF
Loggly - Case Study - Loggly and Docker Deliver Powerful Monitoring for XAPPm...
PDF
Loggly - Case Study - Stanley Black & Decker Transforms Work with Support fro...
PDF
Loggly - Case Study - Loggly and Kubernetes Give Molecule Easy Access to the ...
PDF
Loggly - Case Study - Datami Keeps Developer Productivity High with Loggly
PDF
Loggly - Case Study - BEMOBI - Bemobi Monitors the Experience of 500 Million ...
PDF
Loggly - How to Scale Your Architecture and DevOps Practices for Big Data App...
PDF
Loggly - Benchmarking 5 Node.js Logging Libraries
Loggly - Tools and Techniques For Logging Microservices
Loggly - 5 Popular .NET Logging Libraries
Loggly - IT Operations in a Serverless World (Infographic)
Loggly - Case Study - Loggly and Docker Deliver Powerful Monitoring for XAPPm...
Loggly - Case Study - Stanley Black & Decker Transforms Work with Support fro...
Loggly - Case Study - Loggly and Kubernetes Give Molecule Easy Access to the ...
Loggly - Case Study - Datami Keeps Developer Productivity High with Loggly
Loggly - Case Study - BEMOBI - Bemobi Monitors the Experience of 500 Million ...
Loggly - How to Scale Your Architecture and DevOps Practices for Big Data App...
Loggly - Benchmarking 5 Node.js Logging Libraries

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPT
Teaching material agriculture food technology
PPTX
A Presentation on Artificial Intelligence
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Cloud computing and distributed systems.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
cuic standard and advanced reporting.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
The Rise and Fall of 3GPP – Time for a Sabbatical?
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
NewMind AI Weekly Chronicles - August'25 Week I
MYSQL Presentation for SQL database connectivity
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The AUB Centre for AI in Media Proposal.docx
Reach Out and Touch Someone: Haptics and Empathic Computing
Teaching material agriculture food technology
A Presentation on Artificial Intelligence
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Cloud computing and distributed systems.
Mobile App Security Testing_ A Comprehensive Guide.pdf
cuic standard and advanced reporting.pdf

AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly

  • 1. ARC303 - Unmeltable Infrastructure at Scale: Using Apache Kafka, Twitter Storm and ElasticSearch on AWS Jim Nisbet Philip O’Toole CTO and VP of Engineering, Loggly Lead Developer, Infrastructure, Loggly November 2013 © 2013 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.
  • 2. What Loggly Does •  Log Management as a service –  Near real-time indexing of events •  Distributed architecture, built on AWS •  Initial production services in 2011 –  Loggly Generation 2 released in Sept 2013 •  Thousands of customers
  • 3. Agenda for this Presentation •  •  •  •  •  •  A bit about logging Lessons learned from our first generation How we leverage AWS services Our use of Kafka, Storm, ElasticSearch What worked well for us and what did not Where we are going
  • 4. Log Management •  Everyone starts with … –  A bunch of log files (syslog, application specific) –  On a bunch of machines •  Management consists of doing the simple stuff –  Rotate files, compress and delete –  Information is there but awkward to find specific events –  Weird log retention policies evolve over time
  • 5. “…how can I make this someone else’s problem!” “…hmmm, our logs are getting a bit bloated” Log Volume Self-Inflicted Pain “…let’s spend time managing our log capacity”
  • 6. Best Practices in Log Management •  Use existing logging infrastructure –  Real time syslog forwarding is built in –  Application log file watching •  Store logs externally –  Accessible when there is a system failure •  Log messages in machine parsable format –  JSON encoding when logging structured information –  Key-value pairs
  • 7. From the Trenches… •  Managing Applications vs. Managing Logs –  Do not make this is an either/or proposition! If you get a disk space alert, first login… % sudo rm –rf /var/log/apache2/*! Admit it, we’ve all seen this kind of thing!
  • 8. You Have Logs... 2013-10-25T18:35:43.387+0000: 441.482: [GC [PSYoungGen: 2430541K->268617K(2484544K)] 7687523K>5660738K(8076992K), 0.3266870 secs] [Times: user=1.05 sys=0.17, real=0.33 secs]! 2013-10-25T18:35:43.714+0000: 441.809: [Full GC [PSYoungGen: 268617K->0K(2484544K)] [ParOldGen: 5392121K>354965K(5592448K)] 5660738K->354965K(8076992K) [PSPermGen: 44444K->44395K(83968K)], 0.9225290 secs] [Times: user=2.22 sys=0.26, real=0.92 secs]! •  In this case, JVM garbage collection logs enabled with… -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps
  • 9. Yes, you need to search these logs
  • 10. But you also need to to spot trends
  • 11. Loggly Offers Logging as a Service
  • 12. Loggly First Generation •  Logging as a service –  Real-time searchable logs •  Thousands of customers –  Transmission rates from 10 events/sec to 100k events/sec –  When customers systems are busy they send more logs –  Log traffic has distinct bursts; bursts can last for several hours •  AWS EC2 deployment –  We used EC2 Instance storage •  SOLR Cloud –  Full power of Lucene search –  Tens of thousands of shards (with special ‘sleep shard’ logic) •  ZeroMQ for message queue
  • 13. First Generation Lessons Learned •  Event ingestion too tightly coupled to indexing –  Manual re-indexing for temporary SOLR issues •  Multiple Indexing strategies needed –  4 orders of magnitude difference between our high volume users and our low volume users (10 eps vs. 100,000+ eps) –  Too much system overhead for low volume users –  Difficult to support changing sharding strategies for a customer
  • 14. Big Data Infrastructure Solutions We are not alone… •  Our challenges –  –  –  –  –  Massive incoming event stream Fundamentally multi-tenant Scalable framework for analysis Near real-time indexing Time series index management Scalability Real Time Analytics Multi tenant SaaS
  • 15. Apache Kafka •  Overview –  –  –  –  An Apache project initially developed at LinkedIn Distributed publish-subscribe messaging system Specifically designed for real time activity streams Does not follow JMS Standards nor uses JMS APIs •  Key Features –  –  –  –  Persistent messaging High throughput Uses Zookeeper for forming a cluster of nodes Supports both queue and topic semantics
  • 17. Storm Framework •  Storm (open sourced by Twitter) –  Open sourced September 2011 –  Now an Apache Software Foundation project •  Currently Incubator Status •  Framework is for stream processing –  –  –  –  Distributed Fault tolerant Computation Fail-fast components
  • 18. Storm Logical View Example Topology Bolt Spout Bolt Bolt Spouts emit source stream Bolts perform stream processing Bolt
  • 20. ElasticSearch •  Open source –  Commercial support available from ElasticSearch.com –  Growing open-source community •  •  •  •  •  Distributed search engine Fully exposes Lucene search functionality Built for clustering from the ground-up High availability Multi-tenancy
  • 21. ElasticSearch In Action •  Add/delete nodes dynamically •  Add indexes with REST api •  Indexes and Nodes have attributes –  Indexes automatically moved to best Nodes •  Indexes can be sharded •  Supports bulk insertion of events •  Plugins for monitoring cluster
  • 23. Generation 2 – The Challenge •  Always accept log data –  Never make a customer’s incident worse •  Never drop log data –  A single log message could be critical •  True Elasticity
  • 24. Perfect Match For Real Time Log Events •  Apache Kafka –  Extremely high-performance pub-sub persistent queue •  Consumer tracks their location in queue –  A good fit for our use cases •  Multiple Kafka brokers –  Good match for AWS •  Multiple brokers per region •  Availability Zone separation
  • 25. Real Time Event Processing •  Twitter Storm –  Scalable realtime computation sysytem •  Storm used as a “pull” system –  Provisioned for average load, not peak load –  Input from Kafka queue •  Worker nodes can be scaled dynamically •  Elasticity is key –  Another good match for AWS •  Able to scale workers up and down dynamically
  • 28. Loggly Collector Performance •  C++ multi-threaded •  Boost ASIO framework •  Each Collector can handle 250k+ events per second –  Per m2.2xlarge instance 1 x EC2 m2.2xlarge Collector instance (300 byte average event size).
  • 31. Event Pipeline in Summary •  Storm provides Complex Event Processing –  Where we run much of our secret-sauce •  Stage 1 contains the raw Events •  Stage 2 contains processed Events •  Snapshot the last day of Stage 2 events to S3
  • 33. Loggly and Index Management •  Indexes are time-series data –  Separated by customer –  Represent slices of time •  Higher volume index will have shorter time slice •  Multi-tier architecture for efficient indexing –  Multiple indexing tiers mapped to different AWS instance types •  Efficient use of AWS resources
  • 34. AWS Deployment Instances – Stage 1 c1.xlarge •  •  •  Compute-optimized High-traffic ingestion points Disk not important m2.2xlarge! •  •  Memory-optimized Disk buffer caching 4K Provisioned IOPs EBS •  •  •  Ensures consistent IO No noisy-neighbours Persistent storage
  • 35. AWS Deployment Instances – Stage 2 ZooKeeper c1.xlarge m1.xlarge •  •  •  •  •  •  Compute-optimized CPU-intensive processing Network IO General-purpose Configuration Management m2.2xlarge •  •  •  Memory-optimized Disk buffer caching 4K provisioned IOPs EBS
  • 36. AWS Deployment Instances – Indexing cc2.8xlarge! •  4K Provisioned IOPs EBS m2.4xlarge! •  4K Provisioned IOPs EBS
  • 37. A Few False Starts
  • 38. ELB in front of Collector Had Limitations •  Initial testing used AWS Elastic Load Balancer for incoming events: •  ELB doesn’t allow forwarding port 514 (syslog) •  ELB doesn’t support forwarding UDP •  Event traffic can burst and hit ELB performance limits
  • 39. AWS Route 53 DNS Round Robin a Win •  DNS Round Robin is a pretty basic load balancing –  Not a bump in the wire •  Take advantage of AWS failover health checks –  When a collector goes out of service, it will be out of the DNS rotation •  Round Robin across multiple regions, AZs –  Latency based resolution optimizes inbound traffic •  Collector failover takes longer than it would with ELB
  • 40. Our First Plan for Log Events •  Cassandra –  Highly scalable key-value store –  Impressive write performance a good match for us –  Apache project plus commercial support with DataStax •  Use Cassandra for both our Event Queue and Persistent Store –  Our strategy was to get the raw event in to Cassandra –  …then perform workflow processing on events
  • 41. Design meets Reality •  Cassandra not designed to be a message queue •  Hard to track Events received out-of-order •  Multi-tenancy requires handling data bursts –  Collectors still needed to be able to buffer to disk –  Added complexity and became a point of failure
  • 44. Kafka enables Staging Architecture •  Kafka producer doesn’t care if there are multiple consumers •  Staging system runs pre-production code •  Pub-sub allows us to randomly index a fraction of our production load •  A highly-effective pre-production system
  • 46. Big Wins •  Leveraging AWS services –  –  –  –  Multi-Region, multi-AZ Provisioned IOPS for availability and scale Route 53 DNS support with latency resolution Easy to increase and decrease Storm resources •  Leveraging Open Source infrastructure –  Apache Kafka –  Twitter Storm –  ElasticSearch •  Staging
  • 47. Future of Loggly Infrastructure •  Better use of Amazon Auto Scaling •  Keep logs in region they came from –  We currently keep indexed events in a single region •  Integrate with more external data sources
  • 48. Feedback •  Questions? Send’em to us on twitter: @loggly Kick the tires, sign up: loggly.com/ace Jim Nisbet CTO and VP of Engineering, Loggly Philip O’Toole Lead Developer, Infrastructure, Loggly