Slide 1

Slide 1 text

Eric Azoulay Neustar Web Performance eric.azoulay@neustar.biz Real User Measurements with MongoDB

Slide 2

Slide 2 text

What is… Neustar?

Slide 3

Slide 3 text

Neustar offer »  Number Portability, Common Short Codes & QR Codes »  UltraDNS »  DDoS Protection »  IP Intelligence: Fraud Prevention, Localized Web Content »  Web Performance Management: Performance Monitoring, Load Testing, Real User Measurements

Slide 4

Slide 4 text

»  Synthetic website monitoring »  Load testing service »  Intelligent alerting »  Real User Measurements Neustar Web Performance Management

Slide 5

Slide 5 text

Why Real User Measurements? »  RUM identifies issues experienced by your users »  Covers your users’ locations, browsers, paths in your website »  Data collected: url, total page load time, time to first byte, dns time, redirect time »  Data NOT collected: session, cookie, personal information

Slide 6

Slide 6 text

»  Chrome, FF 7+, IE9+ (more than 2/3 of browsers) Navigation Timing API

Slide 7

Slide 7 text

Neustar Web Performance RUM »  Beta product – free! »  Captures experience of actual users on your site »  Only thing to do is copy a tiny piece of JavaScript code into your web page template »  Performance data is collected for every page visit after the page is done loading »  THIS COULD TURN INTO A LOT OF DATA

Slide 8

Slide 8 text

Why MongoDB? »  Built to scale »  JSON everywhere in a Javascript ecosystem (Node.js) »  No alter table!! »  Ease of use, reduced development time »  Lots of nice features: replica sets, JavaScript shell, mms »  Support from community and 10gen

Slide 9

Slide 9 text

Real User Measurements architecture INPUT OUTPUT MongoDB Magic

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

RUM Web Beacon ns_rum = {}; ns_rum.init = function () { var s = document.createElement ('script'); s.id = 'rum'; s.type = 'text/javascript'; s.src = 'https://djzsy4s19uaxq.cloudfront.net/[your ID]/neustar.beacon.js'; document.getElementsByTagName('head')[0].appendChild(s); } window.addEventListener ? window.addEventListener('load', ns_rum.init, false) : window.attachEvent ? window.attachEvent('onload', ns_rum.init) : false;

Slide 12

Slide 12 text

Data Flow, step 1: browser to data collector https://rum-collector.wpm.neustar.biz/beacon?u=https%3A %2F%2Fmonitor.wpm.neustar.biz %2F&t_done=3505&t_page=1770&r=https%3A%2F %2Frum.wpm.neustar.biz %2F&nt_redirectCount=0&nt_navigationType=0&nt_redirect Time=0&nt_dnsTime=0&nt_connectTime=757&nt_firstPack et=1735&nt_sslTime=203

Slide 13

Slide 13 text

Data Flow, step 2: raw data collection "ts" : ISODate("2012-07-10T12:40:00.231Z"), “mid” : “1234567890abcdef” "ua" : { "asn" : "45839 - piradius net", "co" : "malaysia", ”st" : "kuala lumpur", "ls" : "high", "br" : "firefox 11" }, "u" : “mywebsite.com/example", "t_page" : 4957, "t_dom" : 3702, "t_dns" : 6, "_id" : ObjectId("4ffc22a0f0db9a6f590000e5")

Slide 14

Slide 14 text

Data Flow, step 3: aggregated data collection "ts": ISODate("2012-03-05"), "mid": "CA91DA1B4B6F44229121FA84795D143E", "hours": [ { "hour": 0, "cnt": 12, "tplt": 46000, “apdex”: 0.77, …, “mins": [ { "min": 0, "cnt": 3, "tplt": 6000, “apdex”: 0.69, …

Slide 15

Slide 15 text

Data rollup job »  JS script run every minute on the primary DB node »  Aggregate data, calculate apdex, min/max, add sample counts to buckets »  If day document does not exist, create one padded with 0s »  In-place update of the current hour and minute »  Document does not grow in size (keep padding factor at 1)

Slide 16

Slide 16 text

Keeping data under control »  hourly job to remove old data »  weekly job to compact collections »  monthly job to rotate the MongoDB log files

Slide 17

Slide 17 text

Deployment on Amazon EC2 »  Easy and affordable »  Can scale: from experiment to production »  Redundancy, security groups, etc.

Slide 18

Slide 18 text

Deployment on Amazon EC2 (cont.)

Slide 19

Slide 19 text

Deployment on Amazon EC2 (cont.)

Slide 20

Slide 20 text

Monitoring with MMS

Slide 21

Slide 21 text

Monitoring with MMS (cont.)

Slide 22

Slide 22 text

» 7 days worth of raw data » Quick drill down to the minute RUM UI – Time Series

Slide 23

Slide 23 text

RUM UI – Time Series (cont.)

Slide 24

Slide 24 text

Apdex score »  Measures user satisfaction »  Apdex = (Satisfied + Tolerated/2) / Total Level Time Satisfied <= 2 seconds Tolerated Between 2 and 8 seconds Frustrated Greater than 8 seconds

Slide 25

Slide 25 text

now: with Map Reduce soon: with Aggregation Framework RUM UI – The fun stuff

Slide 26

Slide 26 text

Soon with MongoDB »  TTL collections – 2.2 release »  Aggregation framework – 2.2 release »  Sharding

Slide 27

Slide 27 text

Visit us at wpm.neustar.biz Thank you