SlideShare a Scribd company logo
Performance Case Study
          @Fabian_Frank
       <fabian@pagefault.de>

       Yahoo! Search, Engineer
      Youthmedia.eu,Volunteer
A Dynamic Website
self-contained App
self-contained App
self-contained App
node v0.4.X
                                   multi-core




http://developer.yahoo.com/blogs/ydn/posts/2010/07/multicore_http_server_with_nodejs/
Time Sharing

• Workers

• Event Queue
Event Queue
• does only one thing at a time

• events that occur are queued for
  processing


• after an event was processed the next one
  is fetched from the queue
The difference
   Workers                    Event Queue

1. synchronous call        1. asynchronous call that
                              specifies event(s) that can
2. worker blocked             occur (callback)

3. periodically check if   2. process next event
   worker can go ahead
                           3. specified event occurs and
4. call returns               is put on the queue

5. worker goes ahead on    4. process goes ahead
   next check
Another difference

  Workers               Event Queue

• 1 connection per    • N connections per
  worker                process

• N workers per CPU   • 1 process (per CPU)
Regarding...
• static file serving benchmarks
 • are not relevant, unless you plan to do
    heavy duty static file serving (I’m not)
• hello world benchmarks
 • still ignore most of what matters, e.g.
    accessing a database or other back-ends
Realistic
Real World Benchmark
• a lot of variables that have to be controlled
• more complex, likely to surface weird bugs
• face unanswerable questions
• are expensive to do
• are easy to attack, but hard to defend
My Reasoning

• “I can not compare everything out there
  against everything else. But I can compare
  what I want to use in the future against what
  I am using today.”
Search Case Study
• Right Panel retrieved using AJAX
• { ‘html’: ‘<div>...</div>’, ‘css’: ‘...’, ‘js:’ ‘...’, ... }
Refresh Right Panel
1. receive a request                    JSON API

2. call a JSON API over HTTP                     2.
3. manipulate the data structure         Node.js 3.
                                                   4.
4. render it as HTML using Mustache   1.        5.
5. write back wrapped in JSON            Client
Refresh Right Panel
1. receive a request                   JSON API

2. call a JSON API over HTTP                     2.
3. manipulate the data structure             xy 3.
                                          ro 4.
                                         Node.js
                                         P
4. render it as HTML using Mustache   1.        5.
5. write back wrapped in JSON            Client
Constraints

• Network bandwidth and latency
 • Gigabit and 1ms

• JSON API performance
 • load-balanced cluster with cache
Implementations

• Apache + PHP

• Node.js (+ YUI)

• Manhattan + Mojito
Apache + PHP

• works, in production for decades
• initial response times are “good enough”
• scales, but you need $$$
• baseline to get a feeling for the numbers
Apache + PHP


• 430req/s @ 60ms average latency
 • 99% @ 114ms
Node.js (+ YUI)

• works, but very new and untested stack
• initial response times are very low
• scales extremely well
• YUI works well, but still has pitfalls
Node.js Fun Facts
• >3100 requests per second
 • 100k requests in 32s
 • 9MByte/s network traffic

• serve >2k req/s at 20ms average latency
 • 99% @ 47ms
Node.js
Node.js
Node.js Histogram
~1500req/s | 25 conc.
    12000


                                                                               99% @ 35ms
    10000




        8000
frequency




        6000




        4000




        2000




            0
                11.000 - 17.300 - 23.600 - 29.900 - 36.200 - 42.500 - 48.800 - 55.100 - 61.400 - 67.700 - 74.000 -
                 17.300 23.600 29.900 36.200 42.500 48.800 55.100 61.400 67.700 74.000 80.300
Node.js Histogram
            ~2900/s | 100 conc.
        9000


        8000
                                                                                99% @ 79ms
        7000


        6000
frequency




        5000


        4000


        3000


        2000


        1000


            0
                12.000 - 22.000 - 32.000 - 42.000 - 52.000 - 62.000 - 72.000 - 82.000 - 92.000 - 102.000 - 112.000 -
                 22.000 32.000 42.000 52.000 62.000 72.000 82.000 92.000 102.000 112.000 122.000
Node.js Histogram
            ~3100/s | 200 conc.
        8000



        7000
                                                                                99% @ 152ms
        6000



        5000
frequency




        4000



        3000



        2000



        1000



            0
                14.000 - 33.900 - 53.800 - 73.700 - 93.600 - 113.500 - 133.400 - 153.300 - 173.200 - 193.100 - 213.000 -
                 33.900 53.800 73.700 93.600 113.500 133.400 153.300 173.200 193.100 213.000 232.900
Manhattan + Mojito

• works, but extremely new and untested
  stack
• initial response times are low (60%
  compared to Apache/PHP)
• scales well (twice as good as Apache/PHP)
Manhattan + Mojito
Manhattan + Mojito
Findings
• Both node.js implementations scale linearly
  before CPU usage hits 100%
• Node.js scales extremely well as proxy
• Manhattan and Mojito can perform better
  than Apache and PHP (for this use case)
• Node.js applications are very sensitive to
  memory leaks or complex/blocking code
DNS in Node.js
• getaddrinfo() sys call is synchronous
 • gethostbyname() is, too
• ares_gethostbyname() is asynchronous
 • no cache
• node 0.6 uses a getaddrinfo() thread pool,
  but still relies on ares for other calls
Cocktails

• Manhattan

• Mojito
Manhattan?

   • Yahoo!’s Node.js cloud
   • can run any node.js application
   • allows calls to HTTP APIs (e.g.YQL)
   • deployment of versioned apps
   • apps can specify their environment
http://developer.yahoo.com/blogs/ydn/posts/2011/11/yahoo-announces-cocktails-%E2%80%93-shaken-not-stirred/
Mojito?
   • Yahoo!‘s Node.js MVC framework
   • provides identical similar runtime for your
         code on the client and server
   • contains all server- and client-side code
   • built on top of YUI
   • will be open sourced
http://developer.yahoo.com/blogs/ydn/posts/2011/11/yahoo-announces-cocktails-%E2%80%93-shaken-not-stirred/
The Cocktails way
Mojito Application

Mojit
                        Assets
  Model                 Client JS   Images
           Controller

  View                    CSS         ...
Conclusion
• Node.js can serve hundreds of concurrent
  requests quickly and reliable, “better” than
  Apache/PHP
• It scales extremely well for I/O bound use
  cases
• It tears down the client-server language
  barrier, opening new architectural
  possibilities
Thank you!




Picture: "Esther Müller" / www.jugendfotos.de, CC-License(by-nc)

More Related Content

What's hot

Nanotechnology in building construction materials
Nanotechnology in building construction materialsNanotechnology in building construction materials
Nanotechnology in building construction materials
GLAU, Mathura, UP, India
 
APC InRack (RACS) Configurations
APC  InRack (RACS) ConfigurationsAPC  InRack (RACS) Configurations
APC InRack (RACS) Configurations
Saeed Arabnia
 
Green concrete
Green concrete Green concrete
Green concrete
VodepalliManaswini
 
Special Concrete And Concreting Method
Special Concrete And Concreting MethodSpecial Concrete And Concreting Method
Special Concrete And Concreting Method
Rutvij Patel
 
Introduction and sustainable development in concrete technology
Introduction and sustainable development in concrete technologyIntroduction and sustainable development in concrete technology
Introduction and sustainable development in concrete technology
Kathan Sindhvad
 
Polymer modified concrete 1
Polymer modified concrete 1Polymer modified concrete 1
Polymer modified concrete 1
J C
 
Floating Concrete Research Paper
Floating Concrete Research PaperFloating Concrete Research Paper
Floating Concrete Research Paper
Sagar Kaptan
 
Pre defense sample slide
Pre defense sample slidePre defense sample slide
Partial Use of stone dust in concrete as an alternative of sand
Partial Use of stone dust in concrete as an alternative of sandPartial Use of stone dust in concrete as an alternative of sand
Partial Use of stone dust in concrete as an alternative of sand
Rohan chansoriya
 
Ready-Mix Concrete
Ready-Mix ConcreteReady-Mix Concrete
Ready-Mix Concrete
Uzma Zaki
 
Cement Manufacturing & Sustainability Reports
Cement Manufacturing & Sustainability ReportsCement Manufacturing & Sustainability Reports
Cement Manufacturing & Sustainability Reports
abhibft
 
HVAC for Data Centers
HVAC for Data CentersHVAC for Data Centers
HVAC for Data Centers
ConsultingSpecifyingEngineer
 
25. PYROLYSIS.pptx
25. PYROLYSIS.pptx25. PYROLYSIS.pptx
25. PYROLYSIS.pptx
RENERGISTICS
 
Pervious concrete
Pervious concretePervious concrete
Pervious concrete
Arpit Sethia
 
Aerated concrete
Aerated concreteAerated concrete
Aerated concrete
J C
 
10. geo textile (lecture-10, 11)
10. geo textile (lecture-10, 11)10. geo textile (lecture-10, 11)
10. geo textile (lecture-10, 11)
RezowanulIslamShowro
 
The Tao of DB2
The Tao of DB2The Tao of DB2
The Tao of DB2
Craig Mullins
 
Geotextile in pavement
Geotextile in pavementGeotextile in pavement
Geotextile in pavement
BHAGCHAND MEENA
 

What's hot (20)

Nanotechnology in building construction materials
Nanotechnology in building construction materialsNanotechnology in building construction materials
Nanotechnology in building construction materials
 
Biomass energy
Biomass energyBiomass energy
Biomass energy
 
APC InRack (RACS) Configurations
APC  InRack (RACS) ConfigurationsAPC  InRack (RACS) Configurations
APC InRack (RACS) Configurations
 
Green concrete
Green concrete Green concrete
Green concrete
 
Special Concrete And Concreting Method
Special Concrete And Concreting MethodSpecial Concrete And Concreting Method
Special Concrete And Concreting Method
 
Introduction and sustainable development in concrete technology
Introduction and sustainable development in concrete technologyIntroduction and sustainable development in concrete technology
Introduction and sustainable development in concrete technology
 
Polymer modified concrete 1
Polymer modified concrete 1Polymer modified concrete 1
Polymer modified concrete 1
 
Floating Concrete Research Paper
Floating Concrete Research PaperFloating Concrete Research Paper
Floating Concrete Research Paper
 
Pre defense sample slide
Pre defense sample slidePre defense sample slide
Pre defense sample slide
 
FRC
FRCFRC
FRC
 
Partial Use of stone dust in concrete as an alternative of sand
Partial Use of stone dust in concrete as an alternative of sandPartial Use of stone dust in concrete as an alternative of sand
Partial Use of stone dust in concrete as an alternative of sand
 
Ready-Mix Concrete
Ready-Mix ConcreteReady-Mix Concrete
Ready-Mix Concrete
 
Cement Manufacturing & Sustainability Reports
Cement Manufacturing & Sustainability ReportsCement Manufacturing & Sustainability Reports
Cement Manufacturing & Sustainability Reports
 
HVAC for Data Centers
HVAC for Data CentersHVAC for Data Centers
HVAC for Data Centers
 
25. PYROLYSIS.pptx
25. PYROLYSIS.pptx25. PYROLYSIS.pptx
25. PYROLYSIS.pptx
 
Pervious concrete
Pervious concretePervious concrete
Pervious concrete
 
Aerated concrete
Aerated concreteAerated concrete
Aerated concrete
 
10. geo textile (lecture-10, 11)
10. geo textile (lecture-10, 11)10. geo textile (lecture-10, 11)
10. geo textile (lecture-10, 11)
 
The Tao of DB2
The Tao of DB2The Tao of DB2
The Tao of DB2
 
Geotextile in pavement
Geotextile in pavementGeotextile in pavement
Geotextile in pavement
 

Similar to Node.js Performance Case Study

Usenix LISA 2012 - Choosing a Proxy
Usenix LISA 2012 - Choosing a ProxyUsenix LISA 2012 - Choosing a Proxy
Usenix LISA 2012 - Choosing a Proxy
Leif Hedstrom
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
orkaplan
 
Planning to Fail #phpne13
Planning to Fail #phpne13Planning to Fail #phpne13
Planning to Fail #phpne13
Dave Gardner
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1Mohammad Qureshi
 
Loom promises: be there!
Loom promises: be there!Loom promises: be there!
Loom promises: be there!
Jean-Francois James
 
Node.js: The What, The How and The When
Node.js: The What, The How and The WhenNode.js: The What, The How and The When
Node.js: The What, The How and The When
FITC
 
End-to-end W3C APIs - tpac 2012
End-to-end W3C APIs - tpac 2012End-to-end W3C APIs - tpac 2012
End-to-end W3C APIs - tpac 2012
Alexandre Morgaut
 
Memory Issues in Ruby on Rails Applications
Memory Issues in Ruby on Rails ApplicationsMemory Issues in Ruby on Rails Applications
Memory Issues in Ruby on Rails Applications
Simeon Simeonov
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
tianyi5212222
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
http403
 
Node js quick tour v2
Node js quick tour v2Node js quick tour v2
Node js quick tour v2Wyatt Fang
 
Exploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservicesExploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservices
💡 Tomasz Kogut
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel Aviv
Ron Perlmuter
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tour
q3boy
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS
drupalcampest
 
Celery: The Distributed Task Queue
Celery: The Distributed Task QueueCelery: The Distributed Task Queue
Celery: The Distributed Task Queue
Richard Leland
 
Planning to Fail #phpuk13
Planning to Fail #phpuk13Planning to Fail #phpuk13
Planning to Fail #phpuk13
Dave Gardner
 
Efficient use of NodeJS
Efficient use of NodeJSEfficient use of NodeJS
Efficient use of NodeJSYura Bogdanov
 

Similar to Node.js Performance Case Study (20)

Usenix LISA 2012 - Choosing a Proxy
Usenix LISA 2012 - Choosing a ProxyUsenix LISA 2012 - Choosing a Proxy
Usenix LISA 2012 - Choosing a Proxy
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Planning to Fail #phpne13
Planning to Fail #phpne13Planning to Fail #phpne13
Planning to Fail #phpne13
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
 
Intro to node and mongodb 1
Intro to node and mongodb   1Intro to node and mongodb   1
Intro to node and mongodb 1
 
Loom promises: be there!
Loom promises: be there!Loom promises: be there!
Loom promises: be there!
 
Node.js: The What, The How and The When
Node.js: The What, The How and The WhenNode.js: The What, The How and The When
Node.js: The What, The How and The When
 
20120514 nodejsdublin
20120514 nodejsdublin20120514 nodejsdublin
20120514 nodejsdublin
 
End-to-end W3C APIs - tpac 2012
End-to-end W3C APIs - tpac 2012End-to-end W3C APIs - tpac 2012
End-to-end W3C APIs - tpac 2012
 
Memory Issues in Ruby on Rails Applications
Memory Issues in Ruby on Rails ApplicationsMemory Issues in Ruby on Rails Applications
Memory Issues in Ruby on Rails Applications
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
 
Node js quick tour v2
Node js quick tour v2Node js quick tour v2
Node js quick tour v2
 
Exploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservicesExploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservices
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel Aviv
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tour
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS
 
Celery: The Distributed Task Queue
Celery: The Distributed Task QueueCelery: The Distributed Task Queue
Celery: The Distributed Task Queue
 
Planning to Fail #phpuk13
Planning to Fail #phpuk13Planning to Fail #phpuk13
Planning to Fail #phpuk13
 
Efficient use of NodeJS
Efficient use of NodeJSEfficient use of NodeJS
Efficient use of NodeJS
 

Recently uploaded

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
 
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
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
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
 
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
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
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
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
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
 
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
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
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
 
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
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

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
 
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 Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
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...
 
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
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
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
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
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
 
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...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
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
 
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...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 

Node.js Performance Case Study

  • 1. Performance Case Study @Fabian_Frank <fabian@pagefault.de> Yahoo! Search, Engineer Youthmedia.eu,Volunteer
  • 6. node v0.4.X multi-core http://developer.yahoo.com/blogs/ydn/posts/2010/07/multicore_http_server_with_nodejs/
  • 8. Event Queue • does only one thing at a time • events that occur are queued for processing • after an event was processed the next one is fetched from the queue
  • 9. The difference Workers Event Queue 1. synchronous call 1. asynchronous call that specifies event(s) that can 2. worker blocked occur (callback) 3. periodically check if 2. process next event worker can go ahead 3. specified event occurs and 4. call returns is put on the queue 5. worker goes ahead on 4. process goes ahead next check
  • 10. Another difference Workers Event Queue • 1 connection per • N connections per worker process • N workers per CPU • 1 process (per CPU)
  • 11. Regarding... • static file serving benchmarks • are not relevant, unless you plan to do heavy duty static file serving (I’m not) • hello world benchmarks • still ignore most of what matters, e.g. accessing a database or other back-ends
  • 12. Realistic Real World Benchmark • a lot of variables that have to be controlled • more complex, likely to surface weird bugs • face unanswerable questions • are expensive to do • are easy to attack, but hard to defend
  • 13. My Reasoning • “I can not compare everything out there against everything else. But I can compare what I want to use in the future against what I am using today.”
  • 14. Search Case Study • Right Panel retrieved using AJAX • { ‘html’: ‘<div>...</div>’, ‘css’: ‘...’, ‘js:’ ‘...’, ... }
  • 15. Refresh Right Panel 1. receive a request JSON API 2. call a JSON API over HTTP 2. 3. manipulate the data structure Node.js 3. 4. 4. render it as HTML using Mustache 1. 5. 5. write back wrapped in JSON Client
  • 16. Refresh Right Panel 1. receive a request JSON API 2. call a JSON API over HTTP 2. 3. manipulate the data structure xy 3. ro 4. Node.js P 4. render it as HTML using Mustache 1. 5. 5. write back wrapped in JSON Client
  • 17. Constraints • Network bandwidth and latency • Gigabit and 1ms • JSON API performance • load-balanced cluster with cache
  • 18. Implementations • Apache + PHP • Node.js (+ YUI) • Manhattan + Mojito
  • 19. Apache + PHP • works, in production for decades • initial response times are “good enough” • scales, but you need $$$ • baseline to get a feeling for the numbers
  • 20. Apache + PHP • 430req/s @ 60ms average latency • 99% @ 114ms
  • 21. Node.js (+ YUI) • works, but very new and untested stack • initial response times are very low • scales extremely well • YUI works well, but still has pitfalls
  • 22. Node.js Fun Facts • >3100 requests per second • 100k requests in 32s • 9MByte/s network traffic • serve >2k req/s at 20ms average latency • 99% @ 47ms
  • 25. Node.js Histogram ~1500req/s | 25 conc. 12000 99% @ 35ms 10000 8000 frequency 6000 4000 2000 0 11.000 - 17.300 - 23.600 - 29.900 - 36.200 - 42.500 - 48.800 - 55.100 - 61.400 - 67.700 - 74.000 - 17.300 23.600 29.900 36.200 42.500 48.800 55.100 61.400 67.700 74.000 80.300
  • 26. Node.js Histogram ~2900/s | 100 conc. 9000 8000 99% @ 79ms 7000 6000 frequency 5000 4000 3000 2000 1000 0 12.000 - 22.000 - 32.000 - 42.000 - 52.000 - 62.000 - 72.000 - 82.000 - 92.000 - 102.000 - 112.000 - 22.000 32.000 42.000 52.000 62.000 72.000 82.000 92.000 102.000 112.000 122.000
  • 27. Node.js Histogram ~3100/s | 200 conc. 8000 7000 99% @ 152ms 6000 5000 frequency 4000 3000 2000 1000 0 14.000 - 33.900 - 53.800 - 73.700 - 93.600 - 113.500 - 133.400 - 153.300 - 173.200 - 193.100 - 213.000 - 33.900 53.800 73.700 93.600 113.500 133.400 153.300 173.200 193.100 213.000 232.900
  • 28. Manhattan + Mojito • works, but extremely new and untested stack • initial response times are low (60% compared to Apache/PHP) • scales well (twice as good as Apache/PHP)
  • 31. Findings • Both node.js implementations scale linearly before CPU usage hits 100% • Node.js scales extremely well as proxy • Manhattan and Mojito can perform better than Apache and PHP (for this use case) • Node.js applications are very sensitive to memory leaks or complex/blocking code
  • 32. DNS in Node.js • getaddrinfo() sys call is synchronous • gethostbyname() is, too • ares_gethostbyname() is asynchronous • no cache • node 0.6 uses a getaddrinfo() thread pool, but still relies on ares for other calls
  • 34. Manhattan? • Yahoo!’s Node.js cloud • can run any node.js application • allows calls to HTTP APIs (e.g.YQL) • deployment of versioned apps • apps can specify their environment http://developer.yahoo.com/blogs/ydn/posts/2011/11/yahoo-announces-cocktails-%E2%80%93-shaken-not-stirred/
  • 35. Mojito? • Yahoo!‘s Node.js MVC framework • provides identical similar runtime for your code on the client and server • contains all server- and client-side code • built on top of YUI • will be open sourced http://developer.yahoo.com/blogs/ydn/posts/2011/11/yahoo-announces-cocktails-%E2%80%93-shaken-not-stirred/
  • 36. The Cocktails way Mojito Application Mojit Assets Model Client JS Images Controller View CSS ...
  • 37. Conclusion • Node.js can serve hundreds of concurrent requests quickly and reliable, “better” than Apache/PHP • It scales extremely well for I/O bound use cases • It tears down the client-server language barrier, opening new architectural possibilities
  • 38. Thank you! Picture: "Esther Müller" / www.jugendfotos.de, CC-License(by-nc)

Editor's Notes

  1. \n
  2. \n
  3. JSON\n
  4. \n
  5. JSON\n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n