SlideShare a Scribd company logo
Monitoring with
 Syslog and
EventMachine
About me
Patrick Huesler
Twitter/Github: phuesler

developer@wooga
Berlin, Germany
Monitoring with Syslog and EventMachine
Monitoring with Syslog and EventMachine
Monitoring with Syslog and EventMachine
Wooga

        Social Games



3# game developer on facebook



  ~ 6.5 Million users per day
Monitoring with
 Syslog and
EventMachine
monitor |ˈmänəәtəәr|
verb [ with obj. ]

observe and check the progress or
quality of (something) over a period of
time; keep under systematic review:
equipment was installed to monitor air quality.
                                 Oxford Dictionary
Dashboard
Dashboard
Dashboard
Monitoring with Syslog and EventMachine
Visualization of
  Ticket Sale
Monitoring with Syslog and EventMachine
Concurrent users of
   Magic Land
Monitoring with Syslog and EventMachine
Monster World
 Dashboard
Monitoring with Syslog and EventMachine
Motivation
DevOps
Moving Target
Debugging
“Since the last deploy, the
 number of signup errors
has gone up by 300 %. We
    might have broken
       something.”
Money Hose
Counting Things
Concurrent Users
Logins
Signups
Errors
A rough sketch
Application      Application      Application
  Server           Server           Server




              Event Aggregation




                 Dashboard
Criteria
Simple
Fire And Forget
Non blocking
Criteria

Simple/Lightweight


     Polyglot


 Fire and Forget
A Little Story
Monitoring with Syslog and EventMachine
Not Supported

node.js     NewRelic RPM



erlang      NewRelic RPM
Load Balancer
          haproxy



node.js   node.js   node.js
haproxy logs
haproxy[674]: 127.0.0.1:33320 [15/Oct/2003:08:32:17.654] px-http 
  px-http/srv1 9/0/7/14/+30 200 +243 - - ---- 3/3/3/1/0 0/0 
  "GET /image.iso HTTP/1.0"
send logs   custom syslog
haproxy                      server




                         NewRelic Ruby
 New Relic
                            Agent
haproxy2rpm


http://github.com/wooga/haproxy2rpm
Monitoring with Syslog and EventMachine
Syslog
Syslog
• Standard logging solution for Unix/Linux
• Facility (daemon, cron, user, local0, etc.)
• Priority/Level (Alert, Critical, Error,
  Warning, etc.)
• Client and server
• Since 1980
... It also provides devices which
  would otherwise be unable to
communicate a means to notify
 administrators of problems or
            performance.



   http://en.wikipedia.org/wiki/Syslog
Syslog Format

Date          Hostname Program        : Message
Jan 1 12:12:12 10.245.3.99 foo[421]   :   this is a message
UDP
Fire And Forget
Checklist
Simple/Lightweight   ✔


     Polyglot        ✔


 Fire and Forget     ✔
Build it
send message
Event Source    UDP : 514
                              Event Aggregator




                                Dashboard
send message
Event Source    UDP : 514
                                   Syslog

                                      forward




Dashboard                     Event Aggregator
Event Source
                  # man logger
logger -p local0.notice -t HOSTIDM My Message
Event Source
require 'syslog'

def log(message, level = :warning)
  script_name = $0
  syslog_option = Syslog::LOG_PID | Syslog::LOG_CONS
  Syslog.open($0, syslog_option) do |s|
    s.send(level, message)
  end
end
Server

• Listen on UDP
• Or tail a log file
• receive and parse syslog message
• update a counter
Server
require 'eventmachine'

class Handler < EM::Connection
  def receive_data(data)
    log_line = SyslogParser.parse(data)
    puts log_line.message
  end
end

EM.run {
  host = "127.0.0.1"
  port = "3000"
  EM::open_datagram_socket(host, port, Handler)
}
Syslog Parser

https://github.com/jordansissel/experiments/blob/master/
             ruby/eventmachine-speed/basic.rb
Websocket
require 'em-websocket'

EM.run do
  channel = EM::Channel.new
  options = {:host => "0.0.0.0", :port => 8080}

  EM::WebSocket.start(options) do |ws|
    ws.onopen do
      sid = channel.subscribe{|msg| ws.send msg}
    end

    ws.onclose do
      channel.unsubscribe(sid)
    end
  end
end
Pass on
            EM:Channel
EM.run {
  channel = EM::Channel.new
  # define your websocket server here

  # start udp server
  host = "127.0.0.1"
  port = "3000"

  # pass in the channel to the data handler
  EM::open_datagram_socket(host, port, Handler,
channel)
}
New Handler
class Handler < EM::Connection
  def initialize(*args)
   @channel = args[0]
    @counter = 0
    super *args
  end

  def receive_data(data)
   if data && data.size > 0
      @counter += 1
     @channel.push(@counter)
    end
  end
end
JavaScript
var socket;
var host = "ws://localhost:8080";
var socket = new WebSocket(host);

socket.onopen = function(){
    console.log('open');
}

socket.onmessage = function(msg){
    console.log(msg.data);
}

socket.onclose = function(){
    console.log('closed');
}
Server-sent events
• Push only
• http://dev.w3.org/html5/eventsource/
• http://en.wikipedia.org/wiki/Server-
  sent_events
• http://www.html5rocks.com/en/tutorials/
  casestudies/sunlight_streamcongress.html
What else?
Graphing
http://graphite.wikidot.com/screen-shots
Steal from statsd
  https://github.com/etsy/statsd
Inspiration

• http://codeascraft.etsy.com/2011/02/15/
  measure-anything-measure-everything/
• http://code.flickr.com/blog/2008/10/27/
  counting-timing/
Thank You
Special thanks to

• @wooga for supporting me
• @knutin for facebook faces dashboard
• @hukl for hummingbird video (http://
  vimeo.com/20840998)
Slides
http://www.slideshare.net/wooga
wooga.com/jobs
    WANTED
        dead or alive




   BACKEND DEVELOPER
        REWARD
   www.wooga.com/ jobs/

More Related Content

PDF
What Have Syscalls Done for you Lately?
PDF
Containers: What are they, Really?
PPTX
Linux networking
ODP
Nmap Scripting Engine and http-enumeration
PDF
Fluentd - CNCF Paris
PDF
Nessus scan report using microsoft patchs scan policy - Tareq Hanaysha
PDF
Docker remote-api
ODP
Testing Wi-Fi with OSS Tools
What Have Syscalls Done for you Lately?
Containers: What are they, Really?
Linux networking
Nmap Scripting Engine and http-enumeration
Fluentd - CNCF Paris
Nessus scan report using microsoft patchs scan policy - Tareq Hanaysha
Docker remote-api
Testing Wi-Fi with OSS Tools

What's hot (20)

ODP
nginx: writing your first module
PDF
Relayd: a load balancer for OpenBSD
PDF
Redis & ZeroMQ: How to scale your application
PDF
Networking and Go: An Engineer's Journey (Strangeloop 2019)
PDF
How to admin
PDF
Pf: the OpenBSD packet filter
PDF
How and Why Prometheus' New Storage Engine Pushes the Limits of Time Series D...
PDF
LibreSSL, one year later
PDF
Performance Profiling in Rust
PDF
Centralized + Unified Logging
PDF
Advanced troubleshooting linux performance
PDF
Python twisted
PDF
Improving the ZFS Userland-Kernel API with Channel Programs - BSDCAN 2017 - M...
ODP
Linux kernel debugging(ODP format)
PDF
CoreOS: Control Your Fleet
PDF
CoreOS intro
ODP
Node js lecture
PDF
A little systemtap
PDF
Red hat lvm cheatsheet
PPTX
Socket programming with php
nginx: writing your first module
Relayd: a load balancer for OpenBSD
Redis & ZeroMQ: How to scale your application
Networking and Go: An Engineer's Journey (Strangeloop 2019)
How to admin
Pf: the OpenBSD packet filter
How and Why Prometheus' New Storage Engine Pushes the Limits of Time Series D...
LibreSSL, one year later
Performance Profiling in Rust
Centralized + Unified Logging
Advanced troubleshooting linux performance
Python twisted
Improving the ZFS Userland-Kernel API with Channel Programs - BSDCAN 2017 - M...
Linux kernel debugging(ODP format)
CoreOS: Control Your Fleet
CoreOS intro
Node js lecture
A little systemtap
Red hat lvm cheatsheet
Socket programming with php
Ad

Viewers also liked (20)

PDF
Centralized Logging with syslog
PPTX
Swirl
PDF
Develop plugin for Mozilla Firefox and structure a JS-based application
PDF
NetBSD syslogd with IETF Syslog Protocols
PDF
Configuring Syslog by Octavio
PDF
Stateful Application Server_JRubyConf13_Lukas Rieder
PDF
Erlang as a Cloud Citizen
PDF
JRubyConf2013_Tim Lossen_All your core
PDF
Getting the Most our of your Tools_FrontEnd DevConf2013_Minsk
PDF
Architecture Evolution at Wooga (AWS Cloud Computing for Developers,)
PDF
When Devs Do Ops
PDF
Designing for Scale
PDF
NoSQL Games_NoSQL Roadshow Berlin
PDF
Games for the Masses: Scaling Rails to the Extreme
PDF
Metrics. Driven. Design. (Developer Conference Hamburg 2012)
PDF
How to scale a company - game teams at Wooga
PDF
Event Stream Processing with Kafka (Berlin Buzzwords 2012)
PDF
2013 04-29-evolution of backend
PDF
You are not alone - Scaling multiplayer games
PDF
Stateful_Application_Server_RuPy 2012_Brno
Centralized Logging with syslog
Swirl
Develop plugin for Mozilla Firefox and structure a JS-based application
NetBSD syslogd with IETF Syslog Protocols
Configuring Syslog by Octavio
Stateful Application Server_JRubyConf13_Lukas Rieder
Erlang as a Cloud Citizen
JRubyConf2013_Tim Lossen_All your core
Getting the Most our of your Tools_FrontEnd DevConf2013_Minsk
Architecture Evolution at Wooga (AWS Cloud Computing for Developers,)
When Devs Do Ops
Designing for Scale
NoSQL Games_NoSQL Roadshow Berlin
Games for the Masses: Scaling Rails to the Extreme
Metrics. Driven. Design. (Developer Conference Hamburg 2012)
How to scale a company - game teams at Wooga
Event Stream Processing with Kafka (Berlin Buzzwords 2012)
2013 04-29-evolution of backend
You are not alone - Scaling multiplayer games
Stateful_Application_Server_RuPy 2012_Brno
Ad

Similar to Monitoring with Syslog and EventMachine (20)

PDF
Monitoring with Syslog and EventMachine (RailswayConf 2012)
PDF
Scalable Socket Server by Aryo
PPTX
Getting Data into Splunk
PDF
Syslog Centralization Logging with Windows ~ A techXpress Guide
PDF
Original slides from Ryan Dahl's NodeJs intro talk
PDF
Swift profiling middleware and tools
PPTX
Hunting for APT in network logs workshop presentation
PPTX
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
PDF
InSecure Remote Operations - NullCon 2023 by Yossi Sassi
PPTX
Best Practices in Handling Performance Issues
PDF
soft-shake.ch - Hands on Node.js
PDF
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.
PDF
OSMC 2011 | Case Study - Icinga at Hyves.nl by Jeffrey Lensen
PDF
Infrastructure & System Monitoring using Prometheus
PDF
Linux Desktop Automation
KEY
Writing robust Node.js applications
PPTX
Being HAPI! Reverse Proxying on Purpose
ODP
Introduce about Nodejs - duyetdev.com
PDF
Node.js API 서버 성능 개선기
KEY
PyCon AU 2012 - Debugging Live Python Web Applications
Monitoring with Syslog and EventMachine (RailswayConf 2012)
Scalable Socket Server by Aryo
Getting Data into Splunk
Syslog Centralization Logging with Windows ~ A techXpress Guide
Original slides from Ryan Dahl's NodeJs intro talk
Swift profiling middleware and tools
Hunting for APT in network logs workshop presentation
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
InSecure Remote Operations - NullCon 2023 by Yossi Sassi
Best Practices in Handling Performance Issues
soft-shake.ch - Hands on Node.js
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.
OSMC 2011 | Case Study - Icinga at Hyves.nl by Jeffrey Lensen
Infrastructure & System Monitoring using Prometheus
Linux Desktop Automation
Writing robust Node.js applications
Being HAPI! Reverse Proxying on Purpose
Introduce about Nodejs - duyetdev.com
Node.js API 서버 성능 개선기
PyCon AU 2012 - Debugging Live Python Web Applications

More from Wooga (20)

PPTX
Story of Warlords: Bringing a turn-based strategy game to mobile
PDF
Instagram Celebrities: are they the new cats? - Targetsummit Berlin 2015
PDF
In it for the long haul - How Wooga boosts long-term retention
PDF
Leveling up in localization! - Susan Alma & Dario Quondamstefano
PDF
Evoloution of Ideas
PDF
Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid
PDF
Saying No to the CEO: A Deep Look at Independent Teams - Adam Telfer
PDF
Innovation dank DevOps (DevOpsCon Berlin 2015)
PDF
Big Fish, small pond - strategies for surviving in a maturing market - Ed Biden
PDF
Review mining aps2014 berlin
PDF
Riak & Wooga_Geeek2Geeek Meetup2014 Berlin
PDF
Staying in the Game: Game localization practices for the mobile market
PDF
Startup Weekend_Makers and Games_Philipp Stelzer
PDF
DevOps goes Mobile (daho.am)
PDF
DevOps goes Mobile - Jax 2014 - Jesper Richter-Reichhelm
PDF
CodeFest 2014_Mobile Game Development
PDF
Jelly Splash: Puzzling your way to the top of the App Stores - GDC 2014
PDF
How to hire the best people for your startup-Gitta Blat-Head of People
PDF
Two Ann(e)s and one Julia_Wooga Lady Power from Berlin_SGA2014
PDF
Pocket Gamer Connects 2014_The Experience of Entering the Korean Market
Story of Warlords: Bringing a turn-based strategy game to mobile
Instagram Celebrities: are they the new cats? - Targetsummit Berlin 2015
In it for the long haul - How Wooga boosts long-term retention
Leveling up in localization! - Susan Alma & Dario Quondamstefano
Evoloution of Ideas
Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid
Saying No to the CEO: A Deep Look at Independent Teams - Adam Telfer
Innovation dank DevOps (DevOpsCon Berlin 2015)
Big Fish, small pond - strategies for surviving in a maturing market - Ed Biden
Review mining aps2014 berlin
Riak & Wooga_Geeek2Geeek Meetup2014 Berlin
Staying in the Game: Game localization practices for the mobile market
Startup Weekend_Makers and Games_Philipp Stelzer
DevOps goes Mobile (daho.am)
DevOps goes Mobile - Jax 2014 - Jesper Richter-Reichhelm
CodeFest 2014_Mobile Game Development
Jelly Splash: Puzzling your way to the top of the App Stores - GDC 2014
How to hire the best people for your startup-Gitta Blat-Head of People
Two Ann(e)s and one Julia_Wooga Lady Power from Berlin_SGA2014
Pocket Gamer Connects 2014_The Experience of Entering the Korean Market

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
KodekX | Application Modernization Development
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Approach and Philosophy of On baking technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Cloud computing and distributed systems.
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
A Presentation on Artificial Intelligence
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
Chapter 3 Spatial Domain Image Processing.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
KodekX | Application Modernization Development
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Spectral efficient network and resource selection model in 5G networks
Approach and Philosophy of On baking technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Per capita expenditure prediction using model stacking based on satellite ima...
Digital-Transformation-Roadmap-for-Companies.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Cloud computing and distributed systems.
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Review of recent advances in non-invasive hemoglobin estimation
A Presentation on Artificial Intelligence
The Rise and Fall of 3GPP – Time for a Sabbatical?

Monitoring with Syslog and EventMachine