SlideShare a Scribd company logo
Messaging,
interoperability and log
  aggregation - a new
      framework

   Tomas Doran (t0m) <bobtfish@bobtfish.net>
Who are you?
• Perl Developer
    •   Been paid to write perl code for ~14 years

• Open Source hacker
    •   Catalyst core team
    •   >160 CPAN dists

•   Also C, Javascript, ruby, etc..
Sponsored by
•   state51
    •   Pb of mogilefs, 100+ boxes.
    •   > 4 million tracks on-demand via API
    •   > 400 reqs/s per server, >1Gb peak from backhaul
•   Suretec VOIP Systems
    •   UK voice over IP provider
    •   Extensive API, including WebHooks for notifications
•   TIM Group
    •   International Financial apps
    •   Java / ruby / puppet
What?
• This talk is about my new perl library:
  Message::Passing
Why?
• I’d better stop, and explain a specific
  problem.
• The solution that grew out of this is more
  generic.
• But it illustrates my concerns and design
  choices well.
• And everyone likes a story, right?
Once upon a time...


• I was bored of tailing log files across dozens
  of servers
• splunk was amazing, but unaffordable
Logstash
Centralised logging
• Syslog isn’t good enough
 • UDP is lossy, TCP not much better
 • Limited fields
 • No structure to actual message
 • RFC3164 - “This document describes the
    observed behaviour of the syslog protocol”
Centralised logging
• Syslog isn’t good enough
• Structured app logging
 • We want to log data, rather than text
    from our application
 • E.g. HTTP request - vhost, path, time to
    generate, N db queries etc..
Centralised logging
• Syslog isn’t good enough
• Structured app logging
Centralised logging
• Syslog isn’t good enough
• Structured app logging
• Post-process log files to re-structure
 • We can do this in cases we don’t control
 • Apache logs, etc..
 • SO MANY DATE FORMATS. ARGHH!!
Centralised logging
• Syslog isn’t good enough
• Structured app logging
• Post-process log files to re-structure
• Publish logs as JSON to a message queue
 • JSON is fast, and widely supported
 • Great for arbitrary structured data!
Message queue
• Flattens load spikes!
• Only have to keep up with average message
  volume, not peak volume.
• Logs are bursty! (Peak rate 1000x average.)
• Easy to scale - just add more consumers
• Allows smart routing
• Great as a common integration point.
elasticsearch
• Just tip JSON documents into it
• Figures out type for each field, indexes
  appropriately.
• Free sharding and replication
• Histograms!
Histograms!
• elasticsearch does ‘big data’, not just text
  search.
• Ask arbitrary questions
• Get back aggregate metrics / counts
• Very powerful.
Logstash
  In JRuby, by Jordan Sissel

            Input
Simple:     Filter
           Output

          Flexible
         Extensible
   Plays well with others
    Nice web interface
Logstash
Logstash
 INPUT

 FILTER

OUTPUT
Logstash
 INPUT

 FILTER

OUTPUT
Logstash
Logstash
Logstash
   IS
MASSIVE
440Mb
 IDLE!
2+Gb
working
440Mb
 IDLE!
OH HAI
 JVM
Java (JRuby) decoding
  AMQP is, however
much much faster than
   perl doing that...

       JVM+-
Logstash on each host
   is totally out...

• Running it on elasticsearch servers which
   are already dedicated to this is fine..
• I’d still like to reuse all of it’s parsing
This talk
• Is about my new library: Message::Passing
• The clue is in the name...
• Hopefully really simple
• Maybe even useful!
Wait a second!


• My app logs are already structured!
• Why don’t I just publish AMQP from the
  app
Good question!
• I tried that.
• App logging relies on RabbitMQ being up
• Adds a single point of failure.
• Logging isn’t that important!
• ZeroMQ to the rescue
ZeroMQ has the
    correct semantics
• Pub/Sub sockets
• Never, ever blocking
• Lossy! (If needed)
• Buffer sizes / locations configureable
• Arbitrary message size
• IO done in a background thread
On host log collector
• ZeroMQ SUB socket
 • App logs - pre structured
• Syslog listener
 • Forward rsyslogd
• Log file tailer
• Ship to AMQP
On host log collector
Lets make it generic!
• So, I wanted a log shipper
• I ended up with a framework for messaging
  interoperability
• Whoops!
• Got sick of writing scripts..
Events - my model for
   message passing
• a hash {}
• Output consumes events:
 • method consume ($event) { ...
• Input produces events:
 • has output_to => (..
• Filter does both
Simplifying assumption


$self->output_to->consume($message)
Events
That’s it.
• No, really - that’s all the complexity you
  have to care about!
• Except for the complexity introduced by
  the inputs and outputs you use.
• Unified attribute names / reconnection
  model, etc.. This helps, somewhat..
Inputs and outputs
•   ZeroMQ In / Out
•   AMQP (RabbitMQ) In / Out
•   STOMP (ActiveMQ) In / Out
•   elasticsearch Out
•   Redis PubSub In/Out
•   Syslog In
•   HTTP POST (“WebHooks”) Out
DSL
•   Building more complex
    chains easy!
•   Multiple inputs
• Multiple outputs
• Multiple independent chains
CLI

• 1 Input
• 1 Output
• 1 Filter (default Null)

• For simple use, or testing.
CLI



• Encode / Decode step is just a Filter
• JSON by default
Questions?
Questions?


I can build my log shipper, without using 1/2
                 Gb of RAM.
Questions?


I built my log shipper.
Questions?



24Mb
Demo?
Demo?
Does this actually
         work?
• YES - In production at two sites.
Does this actually
         work?
• YES - In production at two sites.
• Some of the adaptors are partially
  complete
Does this actually
         work?
• YES - In production at two sites.
• Some of the adaptors are partially
  complete
• Dumber than logstash - no multiple
  threads/cores
Does this actually
         work?
• YES - In production at two sites.
• Some of the adaptors are partially
  complete
• Dumber than logstash - no multiple
  threads/cores
• ZeroMQ is insanely fast
Other people are using
     it in production!



Two people I know of already writing adaptors!
What about logstash?
• Use my lightweight code on end nodes.
• Use ‘proper’ logstash for parsing/filtering
  on the dedicated hardware (elasticsearch
  boxes)
• Filter to change my hashes to logstash
  compatible hashes
  • For use with MooseX::Storage and/or
    Log::Message::Structured
Other applications

• Anywhere an asynchronous event stream is
  useful!
• Monitoring
• Metrics transport
• Queued jobs
Other applications
              (Web stuff)

• User activity (ajax ‘what are your users
  doing’)
• WebSockets / MXHR
• HTTP Push notifications - “WebHooks”
WebHooks


• HTTP PUSH notification
• E.g. Paypal IPN
• Shopify API
Messaging patterns
• Pub / Sub (AMQP / STOMP / Redis / ZMQ)
• Round robin (AMQP / STOMP / Redis /
  ZMQ)
• Partial subscribe - ‘routing keys’
 • AMQP - Best at this, wildcards anywhere
 • Redis - wildcards as suffix
 • ZMQ - Exact match
Demo?
Jenga?
Jenga!
Demo?
• The last demo wasn’t silly enough!
• How could I top that?
• Plan - Re-invent mongrel2
• Badly
PSGI
• PSGI $env is basically just a hash.
• (With a little fiddling), you can serialize it as
  JSON
• PSGI response is just an array.
• Ignore streaming responses!
PUSH socket does fan
out between multiple
      handlers.

  Reply to address
embedded in request
Code
• https://metacpan.org/module/
  Message::Passing
• https://github.com/suretec/Message-Passing
• #message-passing on irc.perl.org
• Demo examples:
 • git://gist.github.com/2941747.git

More Related Content

What's hot

Logstash family introduction
Logstash family introductionLogstash family introduction
Logstash family introduction
Owen Wu
 
Atlanta Hadoop Users Meetup 09 21 2016
Atlanta Hadoop Users Meetup 09 21 2016Atlanta Hadoop Users Meetup 09 21 2016
Atlanta Hadoop Users Meetup 09 21 2016
Chris Fregly
 
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Paolo Negri
 
4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian Grodzicki
4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian Grodzicki4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian Grodzicki
4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian Grodzicki
PROIDEA
 
Evented Ruby VS Node.js
Evented Ruby VS Node.jsEvented Ruby VS Node.js
Evented Ruby VS Node.js
Nitin Gupta
 
Tallinn Estonia Advanced Java Meetup Spark + TensorFlow = TensorFrames Oct 24...
Tallinn Estonia Advanced Java Meetup Spark + TensorFlow = TensorFrames Oct 24...Tallinn Estonia Advanced Java Meetup Spark + TensorFlow = TensorFrames Oct 24...
Tallinn Estonia Advanced Java Meetup Spark + TensorFlow = TensorFrames Oct 24...
Chris Fregly
 
Windows IOCP vs Linux EPOLL Performance Comparison
Windows IOCP vs Linux EPOLL Performance ComparisonWindows IOCP vs Linux EPOLL Performance Comparison
Windows IOCP vs Linux EPOLL Performance Comparison
Seungmo Koo
 
IPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-onIPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-on
APNIC
 
Erlang on OSv
Erlang on OSvErlang on OSv
Erlang on OSv
Zvi Avraham
 
Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.
Junichi Ishida
 
Planet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamPlanet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: Bigdam
SATOSHI TAGOMORI
 
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
Paolo Negri
 
epoll() - The I/O Hero
epoll() - The I/O Heroepoll() - The I/O Hero
epoll() - The I/O Hero
Mohsin Hijazee
 
Machine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLMachine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkML
Arnab Biswas
 
Real-world Experiences in Scala
Real-world Experiences in ScalaReal-world Experiences in Scala
Real-world Experiences in Scala
Amir Karimi
 
But we're already open source! Why would I want to bring my code to Apache?
But we're already open source! Why would I want to bring my code to Apache?But we're already open source! Why would I want to bring my code to Apache?
But we're already open source! Why would I want to bring my code to Apache?
gagravarr
 
Dockersh and a brief intro to the docker internals
Dockersh and a brief intro to the docker internalsDockersh and a brief intro to the docker internals
Dockersh and a brief intro to the docker internals
Tomas Doran
 
Performance
PerformancePerformance
Performance
Christophe Marchal
 
CPAN Training
CPAN TrainingCPAN Training
CPAN Training
Pedro Figueiredo
 
Epoll - from the kernel side
Epoll -  from the kernel sideEpoll -  from the kernel side
Epoll - from the kernel side
llj098
 

What's hot (20)

Logstash family introduction
Logstash family introductionLogstash family introduction
Logstash family introduction
 
Atlanta Hadoop Users Meetup 09 21 2016
Atlanta Hadoop Users Meetup 09 21 2016Atlanta Hadoop Users Meetup 09 21 2016
Atlanta Hadoop Users Meetup 09 21 2016
 
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
 
4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian Grodzicki
4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian Grodzicki4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian Grodzicki
4Developers 2015: Scaling LAMP doesn't have to suck - Sebastian Grodzicki
 
Evented Ruby VS Node.js
Evented Ruby VS Node.jsEvented Ruby VS Node.js
Evented Ruby VS Node.js
 
Tallinn Estonia Advanced Java Meetup Spark + TensorFlow = TensorFrames Oct 24...
Tallinn Estonia Advanced Java Meetup Spark + TensorFlow = TensorFrames Oct 24...Tallinn Estonia Advanced Java Meetup Spark + TensorFlow = TensorFrames Oct 24...
Tallinn Estonia Advanced Java Meetup Spark + TensorFlow = TensorFrames Oct 24...
 
Windows IOCP vs Linux EPOLL Performance Comparison
Windows IOCP vs Linux EPOLL Performance ComparisonWindows IOCP vs Linux EPOLL Performance Comparison
Windows IOCP vs Linux EPOLL Performance Comparison
 
IPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-onIPv4aaS tutorial and hands-on
IPv4aaS tutorial and hands-on
 
Erlang on OSv
Erlang on OSvErlang on OSv
Erlang on OSv
 
Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.Great Tools Heavily Used In Japan, You Don't Know.
Great Tools Heavily Used In Japan, You Don't Know.
 
Planet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamPlanet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: Bigdam
 
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
 
epoll() - The I/O Hero
epoll() - The I/O Heroepoll() - The I/O Hero
epoll() - The I/O Hero
 
Machine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLMachine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkML
 
Real-world Experiences in Scala
Real-world Experiences in ScalaReal-world Experiences in Scala
Real-world Experiences in Scala
 
But we're already open source! Why would I want to bring my code to Apache?
But we're already open source! Why would I want to bring my code to Apache?But we're already open source! Why would I want to bring my code to Apache?
But we're already open source! Why would I want to bring my code to Apache?
 
Dockersh and a brief intro to the docker internals
Dockersh and a brief intro to the docker internalsDockersh and a brief intro to the docker internals
Dockersh and a brief intro to the docker internals
 
Performance
PerformancePerformance
Performance
 
CPAN Training
CPAN TrainingCPAN Training
CPAN Training
 
Epoll - from the kernel side
Epoll -  from the kernel sideEpoll -  from the kernel side
Epoll - from the kernel side
 

Viewers also liked

2015 Martin Hastings Resume
2015 Martin Hastings Resume2015 Martin Hastings Resume
2015 Martin Hastings ResumeMartin Hastings
 
Proyecto 4-katherine-piraban
Proyecto 4-katherine-pirabanProyecto 4-katherine-piraban
Proyecto 4-katherine-piraban
Katherine Alejandra Piraban Ramírez
 
The Public Opinion Landscape: Election 2016
The Public Opinion Landscape: Election 2016The Public Opinion Landscape: Election 2016
The Public Opinion Landscape: Election 2016
GloverParkGroup
 
Joomla!, WordPress e Blogs
Joomla!, WordPress e BlogsJoomla!, WordPress e Blogs
Joomla!, WordPress e BlogsMarcio Okabe
 
شيت دمحمددسوقى
شيت دمحمددسوقىشيت دمحمددسوقى
شيت دمحمددسوقىabdoo2020
 
Student recruitment landscape 2.6
Student recruitment landscape 2.6Student recruitment landscape 2.6
Student recruitment landscape 2.6
whatunichennai
 
【各カテゴリに特化した講師によるノウハウ提供型メディア】
【各カテゴリに特化した講師によるノウハウ提供型メディア】【各カテゴリに特化した講師によるノウハウ提供型メディア】
【各カテゴリに特化した講師によるノウハウ提供型メディア】
stucon
 
Video Marketing Rocks
Video Marketing RocksVideo Marketing Rocks
Video Marketing Rocks
Lou Bortone
 
Publicidad estatal
Publicidad estatalPublicidad estatal
[52nd KUG PP] Intro KUG
[52nd KUG PP] Intro KUG[52nd KUG PP] Intro KUG
[52nd KUG PP] Intro KUG
Keynote User Group
 
Professional Resume - Allison
Professional Resume - AllisonProfessional Resume - Allison
Professional Resume - AllisonKatie Allison
 
автосалон комплекс
автосалон комплексавтосалон комплекс
автосалон комплекс
Eugen Tolochin
 
YUI is Sexy - 使用 YUI 作為開發基礎
YUI is Sexy - 使用 YUI 作為開發基礎YUI is Sexy - 使用 YUI 作為開發基礎
YUI is Sexy - 使用 YUI 作為開發基礎
Joseph Chiang
 
TD Personal Brand Journey July2016
TD Personal Brand Journey July2016TD Personal Brand Journey July2016
TD Personal Brand Journey July2016Tony D'Onofrio
 
A s oct 2013 full web
A s oct 2013 full webA s oct 2013 full web
A s oct 2013 full webMadhavbaug
 
Redenção
RedençãoRedenção
Redenção
Tania Maia
 
Proyecto Palisade - Wilson López
Proyecto Palisade - Wilson LópezProyecto Palisade - Wilson López
Proyecto Palisade - Wilson López
Andrés López
 

Viewers also liked (20)

2015 Martin Hastings Resume
2015 Martin Hastings Resume2015 Martin Hastings Resume
2015 Martin Hastings Resume
 
Proyecto 4-katherine-piraban
Proyecto 4-katherine-pirabanProyecto 4-katherine-piraban
Proyecto 4-katherine-piraban
 
Resume 2.29.16
Resume 2.29.16Resume 2.29.16
Resume 2.29.16
 
The Public Opinion Landscape: Election 2016
The Public Opinion Landscape: Election 2016The Public Opinion Landscape: Election 2016
The Public Opinion Landscape: Election 2016
 
Joomla!, WordPress e Blogs
Joomla!, WordPress e BlogsJoomla!, WordPress e Blogs
Joomla!, WordPress e Blogs
 
شيت دمحمددسوقى
شيت دمحمددسوقىشيت دمحمددسوقى
شيت دمحمددسوقى
 
Student recruitment landscape 2.6
Student recruitment landscape 2.6Student recruitment landscape 2.6
Student recruitment landscape 2.6
 
【各カテゴリに特化した講師によるノウハウ提供型メディア】
【各カテゴリに特化した講師によるノウハウ提供型メディア】【各カテゴリに特化した講師によるノウハウ提供型メディア】
【各カテゴリに特化した講師によるノウハウ提供型メディア】
 
resume
resumeresume
resume
 
Video Marketing Rocks
Video Marketing RocksVideo Marketing Rocks
Video Marketing Rocks
 
Publicidad estatal
Publicidad estatalPublicidad estatal
Publicidad estatal
 
[52nd KUG PP] Intro KUG
[52nd KUG PP] Intro KUG[52nd KUG PP] Intro KUG
[52nd KUG PP] Intro KUG
 
Professional Resume - Allison
Professional Resume - AllisonProfessional Resume - Allison
Professional Resume - Allison
 
автосалон комплекс
автосалон комплексавтосалон комплекс
автосалон комплекс
 
Two visualization tools
Two visualization toolsTwo visualization tools
Two visualization tools
 
YUI is Sexy - 使用 YUI 作為開發基礎
YUI is Sexy - 使用 YUI 作為開發基礎YUI is Sexy - 使用 YUI 作為開發基礎
YUI is Sexy - 使用 YUI 作為開發基礎
 
TD Personal Brand Journey July2016
TD Personal Brand Journey July2016TD Personal Brand Journey July2016
TD Personal Brand Journey July2016
 
A s oct 2013 full web
A s oct 2013 full webA s oct 2013 full web
A s oct 2013 full web
 
Redenção
RedençãoRedenção
Redenção
 
Proyecto Palisade - Wilson López
Proyecto Palisade - Wilson LópezProyecto Palisade - Wilson López
Proyecto Palisade - Wilson López
 

Similar to Messaging, interoperability and log aggregation - a new framework

Message:Passing - lpw 2012
Message:Passing - lpw 2012Message:Passing - lpw 2012
Message:Passing - lpw 2012Tomas Doran
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_monTomas Doran
 
Cooking a rabbit pie
Cooking a rabbit pieCooking a rabbit pie
Cooking a rabbit pieTomas Doran
 
London devops logging
London devops loggingLondon devops logging
London devops loggingTomas Doran
 
Performance and Abstractions
Performance and AbstractionsPerformance and Abstractions
Performance and Abstractions
Metosin Oy
 
High scale flavour
High scale flavourHigh scale flavour
High scale flavourTomas Doran
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
SATOSHI TAGOMORI
 
How to Write the Fastest JSON Parser/Writer in the World
How to Write the Fastest JSON Parser/Writer in the WorldHow to Write the Fastest JSON Parser/Writer in the World
How to Write the Fastest JSON Parser/Writer in the World
Milo Yip
 
CPAN Gems From The Far East
CPAN Gems From The Far EastCPAN Gems From The Far East
CPAN Gems From The Far Eastlestrrat
 
Redis Day Keynote Salvatore Sanfillipo Redis Labs
Redis Day Keynote Salvatore Sanfillipo Redis LabsRedis Day Keynote Salvatore Sanfillipo Redis Labs
Redis Day Keynote Salvatore Sanfillipo Redis Labs
Redis Labs
 
Building a Database for the End of the World
Building a Database for the End of the WorldBuilding a Database for the End of the World
Building a Database for the End of the World
jhugg
 
Trick or XFLTReaT a.k.a. Tunnel All The Things
Trick or XFLTReaT a.k.a. Tunnel All The ThingsTrick or XFLTReaT a.k.a. Tunnel All The Things
Trick or XFLTReaT a.k.a. Tunnel All The Things
Balazs Bucsay
 
XFLTReaT: a new dimension in tunnelling (BruCON 0x09 2017)
XFLTReaT: a new dimension in tunnelling (BruCON 0x09 2017)XFLTReaT: a new dimension in tunnelling (BruCON 0x09 2017)
XFLTReaT: a new dimension in tunnelling (BruCON 0x09 2017)
Balazs Bucsay
 
Best practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudBest practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloud
Anshum Gupta
 
Keeping MongoDB Data Safe
Keeping MongoDB Data SafeKeeping MongoDB Data Safe
Keeping MongoDB Data Safe
Tony Tam
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talk
Reuven Lerner
 
EUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old ErlangEUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old Erlang
Paweł Pikuła
 
Scaling with Symfony - PHP UK
Scaling with Symfony - PHP UKScaling with Symfony - PHP UK
Scaling with Symfony - PHP UK
Ricard Clau
 

Similar to Messaging, interoperability and log aggregation - a new framework (20)

Message:Passing - lpw 2012
Message:Passing - lpw 2012Message:Passing - lpw 2012
Message:Passing - lpw 2012
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_mon
 
Cooking a rabbit pie
Cooking a rabbit pieCooking a rabbit pie
Cooking a rabbit pie
 
London devops logging
London devops loggingLondon devops logging
London devops logging
 
Performance and Abstractions
Performance and AbstractionsPerformance and Abstractions
Performance and Abstractions
 
High scale flavour
High scale flavourHigh scale flavour
High scale flavour
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
 
How to Write the Fastest JSON Parser/Writer in the World
How to Write the Fastest JSON Parser/Writer in the WorldHow to Write the Fastest JSON Parser/Writer in the World
How to Write the Fastest JSON Parser/Writer in the World
 
Realtime web2012
Realtime web2012Realtime web2012
Realtime web2012
 
CPAN Gems From The Far East
CPAN Gems From The Far EastCPAN Gems From The Far East
CPAN Gems From The Far East
 
Redis Day Keynote Salvatore Sanfillipo Redis Labs
Redis Day Keynote Salvatore Sanfillipo Redis LabsRedis Day Keynote Salvatore Sanfillipo Redis Labs
Redis Day Keynote Salvatore Sanfillipo Redis Labs
 
Building a Database for the End of the World
Building a Database for the End of the WorldBuilding a Database for the End of the World
Building a Database for the End of the World
 
Trick or XFLTReaT a.k.a. Tunnel All The Things
Trick or XFLTReaT a.k.a. Tunnel All The ThingsTrick or XFLTReaT a.k.a. Tunnel All The Things
Trick or XFLTReaT a.k.a. Tunnel All The Things
 
XFLTReaT: a new dimension in tunnelling (BruCON 0x09 2017)
XFLTReaT: a new dimension in tunnelling (BruCON 0x09 2017)XFLTReaT: a new dimension in tunnelling (BruCON 0x09 2017)
XFLTReaT: a new dimension in tunnelling (BruCON 0x09 2017)
 
Best practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudBest practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloud
 
Keeping MongoDB Data Safe
Keeping MongoDB Data SafeKeeping MongoDB Data Safe
Keeping MongoDB Data Safe
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talk
 
EUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old ErlangEUC2015 - Load testing XMPP servers with Plain Old Erlang
EUC2015 - Load testing XMPP servers with Plain Old Erlang
 
EhTrace -- RoP Hooks
EhTrace -- RoP HooksEhTrace -- RoP Hooks
EhTrace -- RoP Hooks
 
Scaling with Symfony - PHP UK
Scaling with Symfony - PHP UKScaling with Symfony - PHP UK
Scaling with Symfony - PHP UK
 

More from Tomas Doran

Empowering developers to deploy their own data stores
Empowering developers to deploy their own data storesEmpowering developers to deploy their own data stores
Empowering developers to deploy their own data stores
Tomas Doran
 
Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014
Tomas Doran
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflow
Tomas Doran
 
Building a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for DockerBuilding a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for Docker
Tomas Doran
 
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and JenkinsChasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Tomas Doran
 
Deploying puppet code at light speed
Deploying puppet code at light speedDeploying puppet code at light speed
Deploying puppet code at light speed
Tomas Doran
 
Thinking through puppet code layout
Thinking through puppet code layoutThinking through puppet code layout
Thinking through puppet code layout
Tomas Doran
 
Docker puppetcamp london 2013
Docker puppetcamp london 2013Docker puppetcamp london 2013
Docker puppetcamp london 2013
Tomas Doran
 
"The worst code I ever wrote"
"The worst code I ever wrote""The worst code I ever wrote"
"The worst code I ever wrote"
Tomas Doran
 
Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)Tomas Doran
 
Test driven infrastructure development
Test driven infrastructure developmentTest driven infrastructure development
Test driven infrastructure development
Tomas Doran
 
London devops - orc
London devops - orcLondon devops - orc
London devops - orc
Tomas Doran
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testingTomas Doran
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testingTomas Doran
 
Dates aghhhh!!?!?!?!
Dates aghhhh!!?!?!?!Dates aghhhh!!?!?!?!
Dates aghhhh!!?!?!?!
Tomas Doran
 
Large platform architecture in (mostly) perl - an illustrated tour
Large platform architecture in (mostly) perl - an illustrated tourLarge platform architecture in (mostly) perl - an illustrated tour
Large platform architecture in (mostly) perl - an illustrated tour
Tomas Doran
 
Large platform architecture in (mostly) perl
Large platform architecture in (mostly) perlLarge platform architecture in (mostly) perl
Large platform architecture in (mostly) perl
Tomas Doran
 
Web frameworks don't matter
Web frameworks don't matterWeb frameworks don't matter
Web frameworks don't matterTomas Doran
 
CatalystX::SimpleLogin
CatalystX::SimpleLoginCatalystX::SimpleLogin
CatalystX::SimpleLogin
Tomas Doran
 
Herding a Cat with Antlers - Catalyst 5.80
Herding a Cat with Antlers - Catalyst 5.80Herding a Cat with Antlers - Catalyst 5.80
Herding a Cat with Antlers - Catalyst 5.80
Tomas Doran
 

More from Tomas Doran (20)

Empowering developers to deploy their own data stores
Empowering developers to deploy their own data storesEmpowering developers to deploy their own data stores
Empowering developers to deploy their own data stores
 
Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflow
 
Building a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for DockerBuilding a smarter application stack - service discovery and wiring for Docker
Building a smarter application stack - service discovery and wiring for Docker
 
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and JenkinsChasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
 
Deploying puppet code at light speed
Deploying puppet code at light speedDeploying puppet code at light speed
Deploying puppet code at light speed
 
Thinking through puppet code layout
Thinking through puppet code layoutThinking through puppet code layout
Thinking through puppet code layout
 
Docker puppetcamp london 2013
Docker puppetcamp london 2013Docker puppetcamp london 2013
Docker puppetcamp london 2013
 
"The worst code I ever wrote"
"The worst code I ever wrote""The worst code I ever wrote"
"The worst code I ever wrote"
 
Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)
 
Test driven infrastructure development
Test driven infrastructure developmentTest driven infrastructure development
Test driven infrastructure development
 
London devops - orc
London devops - orcLondon devops - orc
London devops - orc
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testing
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testing
 
Dates aghhhh!!?!?!?!
Dates aghhhh!!?!?!?!Dates aghhhh!!?!?!?!
Dates aghhhh!!?!?!?!
 
Large platform architecture in (mostly) perl - an illustrated tour
Large platform architecture in (mostly) perl - an illustrated tourLarge platform architecture in (mostly) perl - an illustrated tour
Large platform architecture in (mostly) perl - an illustrated tour
 
Large platform architecture in (mostly) perl
Large platform architecture in (mostly) perlLarge platform architecture in (mostly) perl
Large platform architecture in (mostly) perl
 
Web frameworks don't matter
Web frameworks don't matterWeb frameworks don't matter
Web frameworks don't matter
 
CatalystX::SimpleLogin
CatalystX::SimpleLoginCatalystX::SimpleLogin
CatalystX::SimpleLogin
 
Herding a Cat with Antlers - Catalyst 5.80
Herding a Cat with Antlers - Catalyst 5.80Herding a Cat with Antlers - Catalyst 5.80
Herding a Cat with Antlers - Catalyst 5.80
 

Recently uploaded

Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 

Recently uploaded (20)

Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 

Messaging, interoperability and log aggregation - a new framework

  • 1. Messaging, interoperability and log aggregation - a new framework Tomas Doran (t0m) <bobtfish@bobtfish.net>
  • 2. Who are you? • Perl Developer • Been paid to write perl code for ~14 years • Open Source hacker • Catalyst core team • >160 CPAN dists • Also C, Javascript, ruby, etc..
  • 3. Sponsored by • state51 • Pb of mogilefs, 100+ boxes. • > 4 million tracks on-demand via API • > 400 reqs/s per server, >1Gb peak from backhaul • Suretec VOIP Systems • UK voice over IP provider • Extensive API, including WebHooks for notifications • TIM Group • International Financial apps • Java / ruby / puppet
  • 4. What? • This talk is about my new perl library: Message::Passing
  • 5. Why? • I’d better stop, and explain a specific problem. • The solution that grew out of this is more generic. • But it illustrates my concerns and design choices well. • And everyone likes a story, right?
  • 6. Once upon a time... • I was bored of tailing log files across dozens of servers • splunk was amazing, but unaffordable
  • 8. Centralised logging • Syslog isn’t good enough • UDP is lossy, TCP not much better • Limited fields • No structure to actual message • RFC3164 - “This document describes the observed behaviour of the syslog protocol”
  • 9. Centralised logging • Syslog isn’t good enough • Structured app logging • We want to log data, rather than text from our application • E.g. HTTP request - vhost, path, time to generate, N db queries etc..
  • 10. Centralised logging • Syslog isn’t good enough • Structured app logging
  • 11. Centralised logging • Syslog isn’t good enough • Structured app logging • Post-process log files to re-structure • We can do this in cases we don’t control • Apache logs, etc.. • SO MANY DATE FORMATS. ARGHH!!
  • 12. Centralised logging • Syslog isn’t good enough • Structured app logging • Post-process log files to re-structure • Publish logs as JSON to a message queue • JSON is fast, and widely supported • Great for arbitrary structured data!
  • 13. Message queue • Flattens load spikes! • Only have to keep up with average message volume, not peak volume. • Logs are bursty! (Peak rate 1000x average.) • Easy to scale - just add more consumers • Allows smart routing • Great as a common integration point.
  • 14. elasticsearch • Just tip JSON documents into it • Figures out type for each field, indexes appropriately. • Free sharding and replication • Histograms!
  • 15. Histograms! • elasticsearch does ‘big data’, not just text search. • Ask arbitrary questions • Get back aggregate metrics / counts • Very powerful.
  • 16. Logstash In JRuby, by Jordan Sissel Input Simple: Filter Output Flexible Extensible Plays well with others Nice web interface
  • 17.
  • 23. Logstash IS MASSIVE
  • 28. Java (JRuby) decoding AMQP is, however much much faster than perl doing that... JVM+-
  • 29. Logstash on each host is totally out... • Running it on elasticsearch servers which are already dedicated to this is fine.. • I’d still like to reuse all of it’s parsing
  • 30. This talk • Is about my new library: Message::Passing • The clue is in the name... • Hopefully really simple • Maybe even useful!
  • 31. Wait a second! • My app logs are already structured! • Why don’t I just publish AMQP from the app
  • 32. Good question! • I tried that. • App logging relies on RabbitMQ being up • Adds a single point of failure. • Logging isn’t that important! • ZeroMQ to the rescue
  • 33. ZeroMQ has the correct semantics • Pub/Sub sockets • Never, ever blocking • Lossy! (If needed) • Buffer sizes / locations configureable • Arbitrary message size • IO done in a background thread
  • 34. On host log collector • ZeroMQ SUB socket • App logs - pre structured • Syslog listener • Forward rsyslogd • Log file tailer • Ship to AMQP
  • 35. On host log collector
  • 36. Lets make it generic! • So, I wanted a log shipper • I ended up with a framework for messaging interoperability • Whoops! • Got sick of writing scripts..
  • 37. Events - my model for message passing • a hash {} • Output consumes events: • method consume ($event) { ... • Input produces events: • has output_to => (.. • Filter does both
  • 40. That’s it. • No, really - that’s all the complexity you have to care about! • Except for the complexity introduced by the inputs and outputs you use. • Unified attribute names / reconnection model, etc.. This helps, somewhat..
  • 41. Inputs and outputs • ZeroMQ In / Out • AMQP (RabbitMQ) In / Out • STOMP (ActiveMQ) In / Out • elasticsearch Out • Redis PubSub In/Out • Syslog In • HTTP POST (“WebHooks”) Out
  • 42. DSL • Building more complex chains easy! • Multiple inputs • Multiple outputs • Multiple independent chains
  • 43. CLI • 1 Input • 1 Output • 1 Filter (default Null) • For simple use, or testing.
  • 44. CLI • Encode / Decode step is just a Filter • JSON by default
  • 46. Questions? I can build my log shipper, without using 1/2 Gb of RAM.
  • 47. Questions? I built my log shipper.
  • 49. Demo?
  • 50. Demo?
  • 51. Does this actually work? • YES - In production at two sites.
  • 52. Does this actually work? • YES - In production at two sites. • Some of the adaptors are partially complete
  • 53. Does this actually work? • YES - In production at two sites. • Some of the adaptors are partially complete • Dumber than logstash - no multiple threads/cores
  • 54. Does this actually work? • YES - In production at two sites. • Some of the adaptors are partially complete • Dumber than logstash - no multiple threads/cores • ZeroMQ is insanely fast
  • 55. Other people are using it in production! Two people I know of already writing adaptors!
  • 56. What about logstash? • Use my lightweight code on end nodes. • Use ‘proper’ logstash for parsing/filtering on the dedicated hardware (elasticsearch boxes) • Filter to change my hashes to logstash compatible hashes • For use with MooseX::Storage and/or Log::Message::Structured
  • 57. Other applications • Anywhere an asynchronous event stream is useful! • Monitoring • Metrics transport • Queued jobs
  • 58. Other applications (Web stuff) • User activity (ajax ‘what are your users doing’) • WebSockets / MXHR • HTTP Push notifications - “WebHooks”
  • 59. WebHooks • HTTP PUSH notification • E.g. Paypal IPN • Shopify API
  • 60. Messaging patterns • Pub / Sub (AMQP / STOMP / Redis / ZMQ) • Round robin (AMQP / STOMP / Redis / ZMQ) • Partial subscribe - ‘routing keys’ • AMQP - Best at this, wildcards anywhere • Redis - wildcards as suffix • ZMQ - Exact match
  • 61. Demo?
  • 64. Demo? • The last demo wasn’t silly enough! • How could I top that? • Plan - Re-invent mongrel2 • Badly
  • 65. PSGI • PSGI $env is basically just a hash. • (With a little fiddling), you can serialize it as JSON • PSGI response is just an array. • Ignore streaming responses!
  • 66. PUSH socket does fan out between multiple handlers. Reply to address embedded in request
  • 67. Code • https://metacpan.org/module/ Message::Passing • https://github.com/suretec/Message-Passing • #message-passing on irc.perl.org • Demo examples: • git://gist.github.com/2941747.git

Editor's Notes

  1. \n
  2. Mention JFDI, and I really don&amp;#x2019;t care what language it&amp;#x2019;s in\n
  3. Mention state51 are hiring in London\nMention Tim Group are hiring in London/Boston.\n
  4. But, before I talk about perl at you, I&amp;#x2019;m going to go off on a tangent..\n
  5. I wrote code. And writing code is never something to be proud of; at least if your code looks like mine it isn&amp;#x2019;t... So I&amp;#x2019;d better justify this hubris somehow..\n
  6. \n
  7. Isn&amp;#x2019;t he cute? And woody!\nWho knows what this is?\n
  8. Ok, so logstash is an open source project, in ruby.\nBefore I talk about it in detail, I&amp;#x2019;ll go through some of the design choices for supporting technologies.\nDoes anyone need convincing why centralised logging is something you want?\n
  9. \n\n
  10. MooseX::Storage!\nThis isn&amp;#x2019;t mandatory - you can just log plain hashes if you&amp;#x2019;re concerned about performance.\nSPOT THE TYPO\n
  11. \n\n
  12. Every language has a JSON library. This makes passing hashes of JSON data around a great way to interoperate.\nNo, really - JSON::XS is lightning fast\n
  13. There are a whole pile of different queue products. Why would you want to use one (for logging to)?\nAverage volume is really important!\nA solution with hosts polling the database server has (at least) a cost of O(n).\nA message queue (can at least theoretically) perform as O(1), no matter how many consumer.\nBy &amp;#x2018;smart routing&amp;#x2019;, I mean you can publish a &amp;#x2018;firehose&amp;#x2019; message stream.\nMost message queue products allow you to get a subset of that stream.\nMost message queues have bindings in most languages.. So by abstracting message routing out of your application, and passing JSON hashes - you are suddenly nicely cross language!\n
  14. If you haven&amp;#x2019;t yet heard of elasticsearch, I recommend you check it out.\nIt&amp;#x2019;s big, it&amp;#x2019;s Java, it needs some care and feeding, but!\nYou can just throw data into it.\nelasticsearch is smart - and works out the field types for you.\nGiven you do things sensibly, elasticsearch is pretty amazing for scaleability and replication - you can just add more boxes to your cluster and it all goes faster!\nPonies and unicorns for everyone.\n
  15. These deserve a little of their own description!\nYou can query across an arbitrary set of JSON documents, fast!\nAnd then get stats about the documents out. Like averages, sums, counts, max/min etc.\nIf you think about this for a bit, you can re-implement all your RRDs in elasticsearch quite easily. Ponies and unicorns for everyone.\nYou may not actually want to re-invent RRD, especially given you have no (native) way of collapsing data points down... However it&amp;#x2019;s brilliant for making up metrics you may want an RRD for, and asking elasticsearch to generate you a graph to see if it might be useful!\n
  16. Very simple model - input (pluggable), filtering (pluggable by type) in C, output (pluggable)\nLots of backends - AMQP and elasticsearch + syslog and many others\nPre-built parser library for various line based log formats\nComes with web app for searches.. Everything I need!\n
  17. And it has an active community.\nThis is the alternate viewer app..\n
  18. Lets take a simple case here - I&amp;#x2019;ll shove my apache logs from N servers into elasticsearch\nI run a logstash on each host (writer), and one on each elasticsearch server (reader)..\n
  19. So, that has 2 logstashes - one reading files and writing AMQP\nOne reading AMQP and writing to elasticsearch\nHowever, my raw apache log lines need parsing (in the filter stage) - to be able to do things like &amp;#x2018;all apache requests with 500 status&amp;#x2019;, rather than &amp;#x2018;all apache requests containing the string 500&amp;#x2019;\n
  20. So, the &amp;#x2018;filter&amp;#x2019; step, for example - is the parsing apache logs and re-structuring them.\n
  21. Red indicates the filtering\n
  22. Except I could instead do the filtering here, if I wanted to.\nDoesn&amp;#x2019;t really matter - depends what&amp;#x2019;s best for me..\nRight, so... Lets try that then?\n
  23. First problem...\n
  24. Well then, I&amp;#x2019;m not going to be running this on the end nodes.\n
  25. And it&amp;#x2019;s not tiny, even on machines dedicated to log parsing / filtering / indexing\n
  26. But sure, I spun it up on a couple of spare machines...\n
  27. It works really well as advertised.\n
  28. The JVM giveth (lots of awesome software), the JVM taketh away (any RAM you had).\nruby is generally slower than perl. jruby is generally faster than perl. jruby trounces perl at (pure ruby) AMQP decoding. MRI 30% slower than perl. JRuby 30% faster than perl!\nSo I&amp;#x2019;m not actually knocking the technology here - just saying it won&amp;#x2019;t work in this situation for me.\n
  29. So, anyway, I&amp;#x2019;m totally stuffed... The previous plan is a non-starter.\nSo I need something to collect logs from each host and ship them to AMQP\nOk, cool, I can write that in plain ruby or plain perl and it&amp;#x2019;s gotta be slimmer, right?\nI still plan to reuse logstash - just not on end nodes!\nHas a whole library of pre-built parsers for common log formats.\nAlso, as noted, it&amp;#x2019;s faster, and notably it&amp;#x2019;s multi-threaded, so it&amp;#x2019;ll use multiple cores..\n
  30. Ok, so hopefully I&amp;#x2019;ve explained one of the problems I want to solve.\nAnd I&amp;#x2019;ve maybe explained why I have the hubris to solve it myself\nI&amp;#x2019;ve tried to keep things (at least conceptually) as simple as possible\nAt the same time, I want something that can be used for real work (i.e. not just a toy)\n
  31. Good question!\n
  32. But wait a second... I just want to get something &amp;#x2018;real&amp;#x2019; running here...\nSo, I&amp;#x2019;m already tipping stuff into AMQP..\n\n\n
  33. ZeroMQ looked like the right answer.\nI played with it. It works REALLY well.\nI&amp;#x2019;d recommend you try it.\nThe last point here is most important - ZMQ networking works entirely in a background thread perl knows nothing about, which means that you can asynchronously ship messages with no changes to your existing codebase.\n
  34. Yes, this could still be &amp;#x2018;a script&amp;#x2019;, in fact I did that at first...\nBut I now have 3 protocols, who&amp;#x2019;s to say I won&amp;#x2019;t want a 4th..\n\n
  35. Note the fact that we have a cluster of ES servers here.\nAnd we have two log indexers.\nYou can cluster RabbitMQ also.\nHighly reliable solution (against machine failure). Highly scaleable solution (just add ES servers)\n
  36. This is where I went crazy.\nThis isn&amp;#x2019;t how I started.\nI am blaming AMQP! Too complex for simple cases\nI had a log shipper script. A long indexer script. An alerting (nagios) script. An irc notification script.\n
  37. I mean, solving this in the simple case has got to be easy, right?\nI stole logstash&amp;#x2019;s terminology!\nAnd here&amp;#x2019;s the API, we have Outputs, which consume messages\nWe have inputs, which output messages.\nFilters are just a combination of input and output\n
  38. So the input has an output, that output always has a consume method...\nTADA!\n
  39. You can build a &amp;#x201C;chain&amp;#x201D; of events. This can work either way around.\nThe input can be a log file, the output can be a message queue (publisher)\nInput can be a message queue, output can be a log file (consumer)\n
  40. STOMP is very different to AMQP is very different to RabbitMQ. I can&amp;#x2019;t really help much here, except for trying to make the docs not suck.\nThe docs still suck, sorry - I have tried ;)\n
  41. All of these are on CPAN already.\n
  42. DSL - Domain specific language.\nTry to make writing scripts really simple.\n
  43. But you shouldn&amp;#x2019;t have to write ANY code to play around.\n
  44. \n
  45. How are we doing for time?\nI can do some demos, or we can have some questions, or both!\n(Remember to click the next slides as people as questions)\n
  46. \n
  47. \n
  48. \n
  49. Demo1\nSimple demo of the CLI in one process (STDOUT/STDIN)\n
  50. Less simple demo - lets actually pass messages between two processes.\nArrows indicate message flow. ZeroMQ is a lightning bolt as it&amp;#x2019;s not quite so trivial..\n
  51. \n
  52. \n
  53. \n
  54. By insanely fast, I mean I can generate, encode as JSON, send, receive, decode as JSON over 25k messages a second. On this 3 year old macbook..\n
  55. \n
  56. \n
  57. \n
  58. I&amp;#x2019;ll talk a very little more about webhooks\n
  59. Error stream\n
  60. \n
  61. Demo PUBSUB and round robin..\n
  62. So, lets play Jenga with message queues!\n
  63. I would have added ZeroMQ. Except then the diagram doesn&amp;#x2019;t fit on the page.\nI&amp;#x2019;ll leave this as an exercise for the reader!\n
  64. \n
  65. \n
  66. \n
  67. \n