SlideShare a Scribd company logo
How to build an app with
Twitter-like throughput
on just 9 servers...
Lew Cirne, Founder & CEO - New Relic
I’m Lew Cirne
@sweetlew
What our app does


APM as a Service

In-app agent instrumentation (BCI, etc)

150,000+ app processes monitored, globally (10K customers)

Each process reports a few hundred metrics per minute

5 Languages (Ruby, Java, PHP, .NET, Python)
Each day we collect 20 billion measurements,
    from 150,000 application processes,
         for over 10,000 customers.
Each day we collect 20 billion measurements,
    from 150,000 application processes,
         for over 10,000 customers.

              All on 9 servers.
We capture “Timeslices”
                              Each o ne is about
Response Time                    250 bytes
4 hours from 11:04 to 15:04
Count: 1242                           A single tweet
Avg: 337 ms
                                       is about the
Min: 0.63 ms
Max: 95669 ms                            same size
Std Dev: 782
timeslice insertion rate: 100K/second

 >7 billion rows per day
                           Twitter peak insertion rate:
                             8K rows per second

  9 Servers handle all
  data collection
How to Build a SaaS App With Twitter-like Throughput on Just 9 Servers
Collecting is one thing...
• We provide realtime monitoring
• One minute granularity
• Data is almost always stale
• Each user/account has different data
• Page caching and other easy solutions don’t work for us.
Our most popular page...

                                    age
                            e Full P
                      Averag Time:
                         Load
                          2.4 Sec
Our most popular page...

                                    age
                            e Full P
                      Averag Time:
                         Load
                          2.4 Sec
Main App Software stack
User Interface       Data Collectors        Data Store
  & REST API                                     MySQL
                       Servlets on Jetty   Sharded by accounts
   Rails 2.3
Simplified architecture...
                                     9 Collector / Aggregator / DB’s
                                                                            Sustained 100K
                                                                            insertion rate per
                                                                            second



                             S
Customer’s environment   HTTP



                                                    24 Core Intel Nehalem
                                                    48 GB RAM
                                                    SAS attached RAID 5
                                                    No Virtualization

      (either cloud
     or datacenter)
                                                                    2 Web App Servers



                                         12 Core Intel Nehalem
                                         48 GB RAM
Even more data!

On May 17, we launched Real User Monitoring
• Using Episodes to measure browser load time of every page view

• Browser reports data to our ‘Beacon’ servers

• Monitoring >1 Billion page views per week

• Doubled our total inbound HTTP requests in a MONTH
Beacon Architecture
                                                           Response Time 0.15ms


                                                          RUM Beacons
          Real User                                                               Asynchronously
          Browsers             Billions of metrics from
                                                          Servlets Capture and
                                   across the globe       enqueue (in-memory)     aggregate and
                                                                                  forward
                                                                                  Timeslices to our
                                                                                  Collectors
  Over 1 Billion user sessions
measured for performance in first                          Currently at EC2
             month.
Challenges
• Data Purging
• Determining what to pre-aggregate
• Large Accounts
• MySQL Optimization and Tuning
• I/O performance - (virtualized to
  dedicated) ...
5 Lessons Learned
1. Keep it simple
2. Less is more
3. Trendy != Reliable
4. Plan for scale
s
                                             s ode
                                         Epi      New

                              Ja                 Relic
                                va
                                                               y
                                                             ub
5. Use the right technology          Ngin
                                         x    Je/y
                                                           R

                                                         Rails
      for a given task
See New Relic
Monitor New Relic
   at our booth

More Related Content

PDF
The Performance and Scalability Mindset
PDF
New Relic .NET Agent Overview
PDF
Building a System That Never Stops New Relic at Scale
PDF
Flink Forward Berlin 2018: Lasse Nedergaard - "Our successful journey with Fl...
PDF
Flink Forward Berlin 2018: Wei-Che (Tony) Wei - "Lessons learned from Migrati...
PDF
New Relic + Apprenda Webinar
PPTX
Oracle Upgrade Project Big Rocks - Done Right!
PPTX
New relic
The Performance and Scalability Mindset
New Relic .NET Agent Overview
Building a System That Never Stops New Relic at Scale
Flink Forward Berlin 2018: Lasse Nedergaard - "Our successful journey with Fl...
Flink Forward Berlin 2018: Wei-Che (Tony) Wei - "Lessons learned from Migrati...
New Relic + Apprenda Webinar
Oracle Upgrade Project Big Rocks - Done Right!
New relic

What's hot (20)

PPTX
Canary releases & Blue green deployment
PDF
The Workshop: Alcanzando una observabilidad unificada con Elastic APM
PPTX
Measure() or die()
PDF
New Relic: Optimizing The Database SQL and NoSQL Alike
PPTX
Vulnerability Discovery in the Cloud
PPTX
Support Office Hour Webinar - LivePerson API
PDF
New Relic
PDF
Let's decipher the DevOps macedonia
PDF
Driving TAS Enterprise Fitness
PPTX
DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
PDF
The Netflix API for a global service
PPTX
AWS Summit - Trends in Advanced Monitoring for AWS environments
PPTX
Flink Forward San Francisco 2018: Andrew Gao & Jeff Sharpe - "Finding Bad Ac...
PPTX
AppDynamics VS New Relic – The Complete Guide
PDF
Thorben Lindhauer: Live Coding: Zeebe - Camunda Day San Francisco
PDF
Wamika Singh, Suman Kumari - Let's decipher the DevOps macedonia - Codemotion...
PDF
Building A System That Never Stops [FutureStack16 NYC]
PDF
Telling the LivePerson Technology Story at Couchbase [SF] 2013
PDF
Migrating Target to Fastly - Eddie Roger at Fastly Altitude 2015
PPTX
Top 5 Java Performance Metrics, Tips & Tricks
Canary releases & Blue green deployment
The Workshop: Alcanzando una observabilidad unificada con Elastic APM
Measure() or die()
New Relic: Optimizing The Database SQL and NoSQL Alike
Vulnerability Discovery in the Cloud
Support Office Hour Webinar - LivePerson API
New Relic
Let's decipher the DevOps macedonia
Driving TAS Enterprise Fitness
DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
The Netflix API for a global service
AWS Summit - Trends in Advanced Monitoring for AWS environments
Flink Forward San Francisco 2018: Andrew Gao & Jeff Sharpe - "Finding Bad Ac...
AppDynamics VS New Relic – The Complete Guide
Thorben Lindhauer: Live Coding: Zeebe - Camunda Day San Francisco
Wamika Singh, Suman Kumari - Let's decipher the DevOps macedonia - Codemotion...
Building A System That Never Stops [FutureStack16 NYC]
Telling the LivePerson Technology Story at Couchbase [SF] 2013
Migrating Target to Fastly - Eddie Roger at Fastly Altitude 2015
Top 5 Java Performance Metrics, Tips & Tricks
Ad

Viewers also liked (20)

PDF
SaaS Introduction-May2014
PDF
The Sweet Science Of Virality
PDF
QA Automation course 2014 - DIO-soft, Kyiv
PDF
SaaS Business Architecture - Definition Update
PPTX
Building Highly Scalable and Flexible SaaS Solutions
PDF
SaaS Business Model: A Unique Business Architecture
PPT
SaaS Business Architecture
PDF
LinkedIn Executive Playbook: 12 Steps to Become a Social Leader
PDF
E-commerce Berlin Expo - Brand24 - Mike Sadowski
PDF
Doing customer development (and stop wasting your time)
PPT
An introduction and overview to Software as a Service
PDF
Scaling Pinterest
PPTX
Architecting SaaS: Doing It Right the First Time
PDF
Key Takeaways from The Sales Development Playbook, part 1 and part 2
PPTX
Chapter 10 Anomaly Detection
PDF
Adobe Summit - Data Storytelling
PDF
Bombora - Intent data - The secret to smarter sales prospecting? - April 2016
PPTX
Software As A Service Presentation
PDF
Top 10 Tech Jobs for 2016
PDF
How to Create a Sales Pitch Deck that Gets the Job Done
SaaS Introduction-May2014
The Sweet Science Of Virality
QA Automation course 2014 - DIO-soft, Kyiv
SaaS Business Architecture - Definition Update
Building Highly Scalable and Flexible SaaS Solutions
SaaS Business Model: A Unique Business Architecture
SaaS Business Architecture
LinkedIn Executive Playbook: 12 Steps to Become a Social Leader
E-commerce Berlin Expo - Brand24 - Mike Sadowski
Doing customer development (and stop wasting your time)
An introduction and overview to Software as a Service
Scaling Pinterest
Architecting SaaS: Doing It Right the First Time
Key Takeaways from The Sales Development Playbook, part 1 and part 2
Chapter 10 Anomaly Detection
Adobe Summit - Data Storytelling
Bombora - Intent data - The secret to smarter sales prospecting? - April 2016
Software As A Service Presentation
Top 10 Tech Jobs for 2016
How to Create a Sales Pitch Deck that Gets the Job Done
Ad

Similar to How to Build a SaaS App With Twitter-like Throughput on Just 9 Servers (20)

PDF
Overcoming the Top Four Challenges to Real‐Time Performance in Large‐Scale, D...
PDF
Overcoming the Top Four Challenges to Real-Time Performance in Large-Scale, D...
PDF
Coates bosc2010 clouds-fluff-and-no-substance
PPTX
Optimizing Your Cloud Applications in RightScale
PDF
Introduction to Databus
PDF
Oracle in the Cloud
PDF
Complex Event Processing: What?, Why?, How?
PDF
Netflix Open Source Meetup Season 4 Episode 2
PPTX
Reactive programming
PPTX
Scaling habits of ASP.NET
PDF
Introduction openstack-meetup-nov-28
PDF
OSDC 2017 | Something Openshift Kubernetes Containers by Kristian Köhntopp
PDF
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
PDF
Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
PDF
Openstack on Fedora, Fedora on Openstack: An Introduction to cloud IaaS
PPTX
Azug - successfully breeding rabits
PPTX
Scalable Resilient Web Services In .Net
PDF
Log everything!
PPTX
Building a system for machine and event-oriented data with Rocana
PDF
Streaming Movies brings you Streamlined Applications -- How Adopting Netflix ...
Overcoming the Top Four Challenges to Real‐Time Performance in Large‐Scale, D...
Overcoming the Top Four Challenges to Real-Time Performance in Large-Scale, D...
Coates bosc2010 clouds-fluff-and-no-substance
Optimizing Your Cloud Applications in RightScale
Introduction to Databus
Oracle in the Cloud
Complex Event Processing: What?, Why?, How?
Netflix Open Source Meetup Season 4 Episode 2
Reactive programming
Scaling habits of ASP.NET
Introduction openstack-meetup-nov-28
OSDC 2017 | Something Openshift Kubernetes Containers by Kristian Köhntopp
The Good, the Bad and the Ugly of Migrating Hundreds of Legacy Applications ...
Migrating Hundreds of Legacy Applications to Kubernetes - The Good, the Bad, ...
Openstack on Fedora, Fedora on Openstack: An Introduction to cloud IaaS
Azug - successfully breeding rabits
Scalable Resilient Web Services In .Net
Log everything!
Building a system for machine and event-oriented data with Rocana
Streaming Movies brings you Streamlined Applications -- How Adopting Netflix ...

More from New Relic (20)

PPTX
7 Tips & Tricks to Having Happy Customers at Scale
PPTX
7 Tips & Tricks to Having Happy Customers at Scale
PDF
New Relic University at Future Stack Tokyo 2019
PDF
FutureStack Tokyo 19 -[事例講演]株式会社リクルートライフスタイル:年間9300万件以上のサロン予約を支えるホットペッパービューティ...
PDF
FutureStack Tokyo 19 -[New Relic テクニカル講演]モニタリングと可視化がデジタルトランスフォーメーションを救う! - サ...
PDF
FutureStack Tokyo 19 -[特別講演]システム開発によろこびと驚きの連鎖を
PDF
FutureStack Tokyo 19 -[パートナー講演]アマゾン ウェブ サービス ジャパン株式会社: New Relicを活用したAWSへのアプリ...
PDF
FutureStack Tokyo 19_インサイトとデータを組織の力にする_株式会社ドワンゴ 池田 明啓 氏
PPTX
Three Monitoring Mistakes and How to Avoid Them
PPTX
Intro to Multidimensional Kubernetes Monitoring
PDF
FS18 Chicago Keynote
PDF
SRE-iously
PDF
10 Things You Can Do With New Relic - Number 9 Will Shock You
PDF
Ground Rules for Code Reviews
PPTX
Understanding Microservice Latency for DevOps Teams: An Introduction to New R...
PPTX
Monitor all your Kubernetes and EKS stack with New Relic
PPTX
Host for the Most: Cloud Cost Optimization
PPTX
New Relic Infrastructure in the Real World: AWS
PPTX
Best Practices for Measuring your Code Pipeline
PPTX
Top Three Mistakes People Make with Monitoring
7 Tips & Tricks to Having Happy Customers at Scale
7 Tips & Tricks to Having Happy Customers at Scale
New Relic University at Future Stack Tokyo 2019
FutureStack Tokyo 19 -[事例講演]株式会社リクルートライフスタイル:年間9300万件以上のサロン予約を支えるホットペッパービューティ...
FutureStack Tokyo 19 -[New Relic テクニカル講演]モニタリングと可視化がデジタルトランスフォーメーションを救う! - サ...
FutureStack Tokyo 19 -[特別講演]システム開発によろこびと驚きの連鎖を
FutureStack Tokyo 19 -[パートナー講演]アマゾン ウェブ サービス ジャパン株式会社: New Relicを活用したAWSへのアプリ...
FutureStack Tokyo 19_インサイトとデータを組織の力にする_株式会社ドワンゴ 池田 明啓 氏
Three Monitoring Mistakes and How to Avoid Them
Intro to Multidimensional Kubernetes Monitoring
FS18 Chicago Keynote
SRE-iously
10 Things You Can Do With New Relic - Number 9 Will Shock You
Ground Rules for Code Reviews
Understanding Microservice Latency for DevOps Teams: An Introduction to New R...
Monitor all your Kubernetes and EKS stack with New Relic
Host for the Most: Cloud Cost Optimization
New Relic Infrastructure in the Real World: AWS
Best Practices for Measuring your Code Pipeline
Top Three Mistakes People Make with Monitoring

Recently uploaded (20)

DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Empathic Computing: Creating Shared Understanding
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Machine learning based COVID-19 study performance prediction
The AUB Centre for AI in Media Proposal.docx
MYSQL Presentation for SQL database connectivity
Programs and apps: productivity, graphics, security and other tools
Per capita expenditure prediction using model stacking based on satellite ima...
Dropbox Q2 2025 Financial Results & Investor Presentation
Spectral efficient network and resource selection model in 5G networks
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Spectroscopy.pptx food analysis technology
Encapsulation_ Review paper, used for researhc scholars
Empathic Computing: Creating Shared Understanding
sap open course for s4hana steps from ECC to s4
Unlocking AI with Model Context Protocol (MCP)
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Machine learning based COVID-19 study performance prediction

How to Build a SaaS App With Twitter-like Throughput on Just 9 Servers

  • 1. How to build an app with Twitter-like throughput on just 9 servers... Lew Cirne, Founder & CEO - New Relic
  • 3. What our app does APM as a Service In-app agent instrumentation (BCI, etc) 150,000+ app processes monitored, globally (10K customers) Each process reports a few hundred metrics per minute 5 Languages (Ruby, Java, PHP, .NET, Python)
  • 4. Each day we collect 20 billion measurements, from 150,000 application processes, for over 10,000 customers.
  • 5. Each day we collect 20 billion measurements, from 150,000 application processes, for over 10,000 customers. All on 9 servers.
  • 6. We capture “Timeslices” Each o ne is about Response Time 250 bytes 4 hours from 11:04 to 15:04 Count: 1242 A single tweet Avg: 337 ms is about the Min: 0.63 ms Max: 95669 ms same size Std Dev: 782
  • 7. timeslice insertion rate: 100K/second >7 billion rows per day Twitter peak insertion rate: 8K rows per second 9 Servers handle all data collection
  • 9. Collecting is one thing... • We provide realtime monitoring • One minute granularity • Data is almost always stale • Each user/account has different data • Page caching and other easy solutions don’t work for us.
  • 10. Our most popular page... age e Full P Averag Time: Load 2.4 Sec
  • 11. Our most popular page... age e Full P Averag Time: Load 2.4 Sec
  • 12. Main App Software stack User Interface Data Collectors Data Store & REST API MySQL Servlets on Jetty Sharded by accounts Rails 2.3
  • 13. Simplified architecture... 9 Collector / Aggregator / DB’s Sustained 100K insertion rate per second S Customer’s environment HTTP 24 Core Intel Nehalem 48 GB RAM SAS attached RAID 5 No Virtualization (either cloud or datacenter) 2 Web App Servers 12 Core Intel Nehalem 48 GB RAM
  • 14. Even more data! On May 17, we launched Real User Monitoring • Using Episodes to measure browser load time of every page view • Browser reports data to our ‘Beacon’ servers • Monitoring >1 Billion page views per week • Doubled our total inbound HTTP requests in a MONTH
  • 15. Beacon Architecture Response Time 0.15ms RUM Beacons Real User Asynchronously Browsers Billions of metrics from Servlets Capture and across the globe enqueue (in-memory) aggregate and forward Timeslices to our Collectors Over 1 Billion user sessions measured for performance in first Currently at EC2 month.
  • 16. Challenges • Data Purging • Determining what to pre-aggregate • Large Accounts • MySQL Optimization and Tuning • I/O performance - (virtualized to dedicated) ...
  • 18. 1. Keep it simple
  • 19. 2. Less is more
  • 20. 3. Trendy != Reliable
  • 21. 4. Plan for scale
  • 22. s s ode Epi New
 Ja Relic va y ub 5. Use the right technology Ngin x Je/y R Rails for a given task
  • 23. See New Relic Monitor New Relic at our booth

Editor's Notes