SlideShare a Scribd company logo
1 of 49
Download to read offline
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 2010
– 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
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
– Near 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

• Amazon 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 indexing 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, low overhead
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

Bolt
Spouts emit source stream

Bolts perform stream processing

Storm terminology
• Streams, Spouts, Bolts, Tasks, Workers, Stream Groups and Topologies
Storm Resource 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 indices with REST API
• Indices and Nodes have attributes
– Indices automatically moved to best Nodes

• Indices 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 real-time computation system

• 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
Queue
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

Classification

Kafka
Queue

Kafka
Queue

Rate
Determination
Summary
Statistics

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

• Kafka contains both raw and processed Events
• Snapshot the last day of Kafka events to S3
Elastic Search Clusters

From Kafka

Multi-Tiered
Elastic Cluster
Loggly and Index Management
• Indices 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
Staging Pre-Production System
Load Balancing

Kafka
Queue
Kafka enables Staging Architecture
• Kafka Broker 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 Deployment Details
AWS Deployment Instances – Collection

c1.xlarge

m2.2xlarge

•
•
•

•
•

Compute-optimized
High-traffic ingestion points
Disk not important

Memory-optimized
Disk buffer caching

4K Provisioned IOPs EBS
•
•
•

Ensures consistent IO
No noisy-neighbors
Persistent storage
AWS Deployment Instances – Processing

ZooKeeper

c1.xlarge
•
•
•

Compute-optimized
CPU-intensive
processing
Network IO

m1.xlarge
•
•
•

General-purpose
Configuration
Management
AWS Deployment Instances – Indexing

cc2.8xlarge
• 4K Provisioned IOPs EBS

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

• Elastic Load Balancing doesn’t allow forwarding port 514 (syslog)
• Elastic Load Balancing doesn’t support forwarding UDP
• Event traffic can burst and hit Elastic Load Balancing performance
limits
Amazon Route 53 DNS Round Robin a Win
• DNS Round Robin is 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
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
Big Wins
• Leveraging AWS services
–
–
–
–

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

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

• Pre-production “Staging” system
The Means to an End
Feedback
• Questions?

Jim Nisbet (niz@loggly.com)
CTO and VP of Engineering, Loggly

Philip O’Toole (philip@loggly.com)
Lead Developer, Infrastructure, Loggly

Follow us @loggly!
Please give us your feedback on this
presentation

ARC303
As a thank you, we will select prize
winners daily for completed surveys!

More Related Content

What's hot

Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan EwenAdvanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
confluent
 
Kafka replication apachecon_2013
Kafka replication apachecon_2013Kafka replication apachecon_2013
Kafka replication apachecon_2013
Jun Rao
 
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
StreamNative
 

What's hot (20)

Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...
Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...
Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...
 
Change Data Streaming Patterns for Microservices With Debezium
Change Data Streaming Patterns for Microservices With Debezium Change Data Streaming Patterns for Microservices With Debezium
Change Data Streaming Patterns for Microservices With Debezium
 
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
 
Apache Kafka 0.8 basic training - Verisign
Apache Kafka 0.8 basic training - VerisignApache Kafka 0.8 basic training - Verisign
Apache Kafka 0.8 basic training - Verisign
 
Flink Streaming
Flink StreamingFlink Streaming
Flink Streaming
 
The Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesThe Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization Opportunities
 
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan EwenAdvanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
 
AWS Lake Formation을 통한 손쉬운 데이터 레이크 구성 및 관리 - 윤석찬 :: AWS Unboxing 온라인 세미나
AWS Lake Formation을 통한 손쉬운 데이터 레이크 구성 및 관리 - 윤석찬 :: AWS Unboxing 온라인 세미나AWS Lake Formation을 통한 손쉬운 데이터 레이크 구성 및 관리 - 윤석찬 :: AWS Unboxing 온라인 세미나
AWS Lake Formation을 통한 손쉬운 데이터 레이크 구성 및 관리 - 윤석찬 :: AWS Unboxing 온라인 세미나
 
AWS EMR Cost optimization
AWS EMR Cost optimizationAWS EMR Cost optimization
AWS EMR Cost optimization
 
Building Reliable Lakehouses with Apache Flink and Delta Lake
Building Reliable Lakehouses with Apache Flink and Delta LakeBuilding Reliable Lakehouses with Apache Flink and Delta Lake
Building Reliable Lakehouses with Apache Flink and Delta Lake
 
Kafka replication apachecon_2013
Kafka replication apachecon_2013Kafka replication apachecon_2013
Kafka replication apachecon_2013
 
Spark with Delta Lake
Spark with Delta LakeSpark with Delta Lake
Spark with Delta Lake
 
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
Security and Multi-Tenancy with Apache Pulsar in Yahoo! (Verizon Media) - Pul...
 
Producer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaProducer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache Kafka
 
A Thorough Comparison of Delta Lake, Iceberg and Hudi
A Thorough Comparison of Delta Lake, Iceberg and HudiA Thorough Comparison of Delta Lake, Iceberg and Hudi
A Thorough Comparison of Delta Lake, Iceberg and Hudi
 
kafka
kafkakafka
kafka
 
From HDFS to S3: Migrate Pinterest Apache Spark Clusters
From HDFS to S3: Migrate Pinterest Apache Spark ClustersFrom HDFS to S3: Migrate Pinterest Apache Spark Clusters
From HDFS to S3: Migrate Pinterest Apache Spark Clusters
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
 
Tuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptxTuning Apache Kafka Connectors for Flink.pptx
Tuning Apache Kafka Connectors for Flink.pptx
 
Module 2 - Datalake
Module 2 - DatalakeModule 2 - Datalake
Module 2 - Datalake
 

Viewers also liked

Viewers also liked (20)

Real time Analytics with Apache Kafka and Apache Spark
Real time Analytics with Apache Kafka and Apache SparkReal time Analytics with Apache Kafka and Apache Spark
Real time Analytics with Apache Kafka and Apache Spark
 
Introduction to Kafka Streams
Introduction to Kafka StreamsIntroduction to Kafka Streams
Introduction to Kafka Streams
 
Developing Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaDeveloping Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache Kafka
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
An Introduction to Elastic Search.
An Introduction to Elastic Search.An Introduction to Elastic Search.
An Introduction to Elastic Search.
 
Introducing Kafka Streams, the new stream processing library of Apache Kafka,...
Introducing Kafka Streams, the new stream processing library of Apache Kafka,...Introducing Kafka Streams, the new stream processing library of Apache Kafka,...
Introducing Kafka Streams, the new stream processing library of Apache Kafka,...
 
Building Stream Infrastructure across Multiple Data Centers with Apache Kafka
Building Stream Infrastructure across Multiple Data Centers with Apache KafkaBuilding Stream Infrastructure across Multiple Data Centers with Apache Kafka
Building Stream Infrastructure across Multiple Data Centers with Apache Kafka
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Why @Loggly Loves Apache Kafka, and How We Use Its Unbreakable Messaging for ...
Why @Loggly Loves Apache Kafka, and How We Use Its Unbreakable Messaging for ...Why @Loggly Loves Apache Kafka, and How We Use Its Unbreakable Messaging for ...
Why @Loggly Loves Apache Kafka, and How We Use Its Unbreakable Messaging for ...
 
Apache Kafka at LinkedIn
Apache Kafka at LinkedInApache Kafka at LinkedIn
Apache Kafka at LinkedIn
 
Being Ready for Apache Kafka - Apache: Big Data Europe 2015
Being Ready for Apache Kafka - Apache: Big Data Europe 2015Being Ready for Apache Kafka - Apache: Big Data Europe 2015
Being Ready for Apache Kafka - Apache: Big Data Europe 2015
 
Elastic Search
Elastic SearchElastic Search
Elastic Search
 
Building a Real Time Dashboard with Amazon Kinesis, Amazon Lambda and Amazon ...
Building a Real Time Dashboard with Amazon Kinesis, Amazon Lambda and Amazon ...Building a Real Time Dashboard with Amazon Kinesis, Amazon Lambda and Amazon ...
Building a Real Time Dashboard with Amazon Kinesis, Amazon Lambda and Amazon ...
 
Real-time streaming and data pipelines with Apache Kafka
Real-time streaming and data pipelines with Apache KafkaReal-time streaming and data pipelines with Apache Kafka
Real-time streaming and data pipelines with Apache Kafka
 
Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...
Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...
Building Large-Scale Stream Infrastructures Across Multiple Data Centers with...
 
Building a Replicated Logging System with Apache Kafka
Building a Replicated Logging System with Apache KafkaBuilding a Replicated Logging System with Apache Kafka
Building a Replicated Logging System with Apache Kafka
 
(Elastic)search in big data
(Elastic)search in big data(Elastic)search in big data
(Elastic)search in big data
 
Apache Kafka lessons learned @PAYBACK
Apache Kafka lessons learned @PAYBACKApache Kafka lessons learned @PAYBACK
Apache Kafka lessons learned @PAYBACK
 
Netflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaNetflix Data Pipeline With Kafka
Netflix Data Pipeline With Kafka
 
Kafka At Scale in the Cloud
Kafka At Scale in the CloudKafka At Scale in the Cloud
Kafka At Scale in the Cloud
 

Similar to Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303) | AWS re:Invent 2013

Extending Spark Streaming to Support Complex Event Processing
Extending Spark Streaming to Support Complex Event ProcessingExtending Spark Streaming to Support Complex Event Processing
Extending Spark Streaming to Support Complex Event Processing
Oh Chan Kwon
 

Similar to Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303) | AWS re:Invent 2013 (20)

AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly
AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly
AWS re:Invent presentation: Unmeltable Infrastructure at Scale by Loggly
 
Cloud Security Monitoring and Spark Analytics
Cloud Security Monitoring and Spark AnalyticsCloud Security Monitoring and Spark Analytics
Cloud Security Monitoring and Spark Analytics
 
Spark cep
Spark cepSpark cep
Spark cep
 
Extending Spark Streaming to Support Complex Event Processing
Extending Spark Streaming to Support Complex Event ProcessingExtending Spark Streaming to Support Complex Event Processing
Extending Spark Streaming to Support Complex Event Processing
 
(BDT318) How Netflix Handles Up To 8 Million Events Per Second
(BDT318) How Netflix Handles Up To 8 Million Events Per Second(BDT318) How Netflix Handles Up To 8 Million Events Per Second
(BDT318) How Netflix Handles Up To 8 Million Events Per Second
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
 
Amazon RDS for MySQL – Diagnostics, Security, and Data Migration (DAT302) | A...
Amazon RDS for MySQL – Diagnostics, Security, and Data Migration (DAT302) | A...Amazon RDS for MySQL – Diagnostics, Security, and Data Migration (DAT302) | A...
Amazon RDS for MySQL – Diagnostics, Security, and Data Migration (DAT302) | A...
 
Netflix Keystone—Cloud scale event processing pipeline
Netflix Keystone—Cloud scale event processing pipelineNetflix Keystone—Cloud scale event processing pipeline
Netflix Keystone—Cloud scale event processing pipeline
 
TenMax Data Pipeline Experience Sharing
TenMax Data Pipeline Experience SharingTenMax Data Pipeline Experience Sharing
TenMax Data Pipeline Experience Sharing
 
TechEvent 2019: Oracle Databases as Managed Service at AWS, Yes it works!; Al...
TechEvent 2019: Oracle Databases as Managed Service at AWS, Yes it works!; Al...TechEvent 2019: Oracle Databases as Managed Service at AWS, Yes it works!; Al...
TechEvent 2019: Oracle Databases as Managed Service at AWS, Yes it works!; Al...
 
Flink forward-2017-netflix keystones-paas
Flink forward-2017-netflix keystones-paasFlink forward-2017-netflix keystones-paas
Flink forward-2017-netflix keystones-paas
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolith
 
Create cloud service on AWS
Create cloud service on AWSCreate cloud service on AWS
Create cloud service on AWS
 
Scality S3 Server: Node js Meetup Presentation
Scality S3 Server: Node js Meetup PresentationScality S3 Server: Node js Meetup Presentation
Scality S3 Server: Node js Meetup Presentation
 
Performance architecture for cloud connect
Performance architecture for cloud connectPerformance architecture for cloud connect
Performance architecture for cloud connect
 
AWS glue technical enablement training
AWS glue technical enablement trainingAWS glue technical enablement training
AWS glue technical enablement training
 
Case Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets at Cisco IntercloudCase Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets at Cisco Intercloud
 
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco IntercloudCase Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud
Case Study: Elasticsearch Ingest Using StreamSets @ Cisco Intercloud
 
Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !
 
Flying Server-less on the Cloud with AWS Lambda
Flying Server-less on the Cloud with AWS LambdaFlying Server-less on the Cloud with AWS Lambda
Flying Server-less on the Cloud with AWS Lambda
 

More from Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Infrastructure at Scale: Apache Kafka, Twitter Storm & Elastic Search (ARC303) | AWS re:Invent 2013

  • 1. 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 2010 – 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
  • 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 – Near 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 • Amazon 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 indexing 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, low overhead 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 Bolt Spouts emit source stream Bolts perform stream processing Storm terminology • Streams, Spouts, Bolts, Tasks, Workers, Stream Groups and Topologies
  • 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 indices with REST API • Indices and Nodes have attributes – Indices automatically moved to best Nodes • Indices 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 real-time computation system • 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 • Kafka contains both raw and processed Events • Snapshot the last day of Kafka events to S3
  • 32. Elastic Search Clusters From Kafka Multi-Tiered Elastic Cluster
  • 33. Loggly and Index Management • Indices 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
  • 36. Kafka enables Staging Architecture • Kafka Broker 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
  • 38. AWS Deployment Instances – Collection c1.xlarge m2.2xlarge • • • • • Compute-optimized High-traffic ingestion points Disk not important Memory-optimized Disk buffer caching 4K Provisioned IOPs EBS • • • Ensures consistent IO No noisy-neighbors Persistent storage
  • 39. AWS Deployment Instances – Processing ZooKeeper c1.xlarge • • • Compute-optimized CPU-intensive processing Network IO m1.xlarge • • • General-purpose Configuration Management
  • 40. AWS Deployment Instances – Indexing cc2.8xlarge • 4K Provisioned IOPs EBS m2.4xlarge • 4K Provisioned IOPs EBS
  • 41. A Few False Starts
  • 42. Elastic Load Balancing in front of Collector Had Limitations • Initial testing used Elastic Load Balancing for incoming events: • Elastic Load Balancing doesn’t allow forwarding port 514 (syslog) • Elastic Load Balancing doesn’t support forwarding UDP • Event traffic can burst and hit Elastic Load Balancing performance limits
  • 43. Amazon Route 53 DNS Round Robin a Win • DNS Round Robin is 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
  • 44. 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
  • 45. 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
  • 46. Big Wins • Leveraging AWS services – – – – Multi-region, multi-AZ Provisioned IOPS for availability and scale Amazon Route 53 DNS support with latency resolution Easy to increase and decrease Storm resources • Leveraging Open Source infrastructure – Apache Kafka – Twitter Storm – ElasticSearch • Pre-production “Staging” system
  • 47. The Means to an End
  • 48. Feedback • Questions? Jim Nisbet (niz@loggly.com) CTO and VP of Engineering, Loggly Philip O’Toole (philip@loggly.com) Lead Developer, Infrastructure, Loggly Follow us @loggly!
  • 49. Please give us your feedback on this presentation ARC303 As a thank you, we will select prize winners daily for completed surveys!