SlideShare a Scribd company logo
A million connections...
   AND BEYOND!!!
     Node.js at Scale
One million
connections!!!
A million isn't
very much these
     days...
One hundred
    billion
connections!!!
What this talk is really
       about
  Picking meaningful benchmarks

  Current state of Node.js benchmarks

  Understanding why benchmarks aren't _that_
  important

  How to pick the right language/framework/lib
What can we measure?

Computation    Disk I/O

Net work I/O   Throughput

  TCP          Libraries

  UDP            URL Parsing

  HTTP           etc
How do we measure?


 Load averages

 Memory usage

 Average time - Average perf. of each operation

 Latency - Actual performance of each operation
Comparison

Erlang vs. Node.js vs. Tornado

3 Erlang libs

Stock Node.js

Stock Tornado

Single core
Desired vs. Real
  Responses
Response times
I pity the fool who
     uses Node
Questioning benchmarks


   What do average times mean?

     Responses on a curve

   Who uses in memory servers?
Finding Node's strength
 connections: 933990

 errors: 0

 Read from remote host gqzdj9ab.joyent.us:
 Operation timed out

 Connection to gqzdj9ab.joyent.us closed.

 Enki:~ $
var net = require('net')


var conns = 0


function connectToServer(ip) {
    conn = net.createConnection(8000, ip)
    conn.on('connect', function() {
      conns += 1
    })
    conn.on('end', function() {
     conns -= 1
    })
}


for(i=0;i<61000;i++) {
    connectToServer('72.2.120.106')
}
var net = require('net')


var s = net.createServer()
var c = 0;
var e = 0;


s.on('connection', function(socket) {
 c += 1


 socket.on('end', function() {
  c -= 1
 })
 socket.on('error', function(e) {
   e += 1
 })
})


s.listen(8000)


setInterval(function() {
 console.log('connections: ' + c)
  console.log('errors: ' + e)
}, 5000)
Finding Node's strength
    PID USERNAME SIZE RSS STATE PRI NICE      TIME CPU PROCESS/NLWP

  22593 root    758M 642M cpu11 25       0 0:17:54 6.2% node/1

  22542 croucher 4308K 3084K cpu2   59     0 0:00:08 0.2% prstat/1

 ...



 ...



 ZONEID     NPROC SWAP RSS MEMORY        TIME CPU ZONE

       27   31 1489M 782M   38% 1:59:54 6.3% gqzdj9ab
Where to use atomic
  measurements

 Measuring performance improvements over time

 Figuring out the hot-path

 Profiling against your specific use case
8x Perf
improvement
I am a super




                                        stuff
       effective
     measurement
 Because I put stuff on one axis and
 things on another and now I'm like             things
proper science and you should totally
 use me to base all your judgements
       about everything on…

           no seriously...
Why benchmarks aren't
as important as we think

   There is a tradeoff bet ween performance and
   productivity

   If this weren't true we'd all still be writing in ASM
Fit for purpose
Sandboxed language       Event Driven
   PHP, Python              Node.js

   Java, C#                 Event Machine (Ruby)
   Ruby, etc                Tornado (Python)

                         Message Passing
                            Erlang
Class of languages for the
          Internet
    New languages/platforms like Node.js designed for
    Internet applications

    New class of languages are efficient enough, but are
    they easy enough?

    Node.js designed from scratch for net work server
    programming
Reasons to use Node

 It's really fast. Very much fast enough.

 It's easy to use for Internet/Web applications.

 It's JavaScript.

 It has an extremely active community.

 It has a lot of project velocity.
What we need from
  benchmarks
Benchmarks to test real world use cases
  Servers that do more than just 'hello world'
Benchmarks to compare real test cases from many
platforms
Benchmarks that reflect mobile clients
Node CI on many platforms
Questions?

I'm on Twitter http:/ witter.com/sh1mmer
                     /t

  That's a "one" in my nick

Check out the book on http://ofps.oreilly.com

  It's free to read and comment. New release this
  week

More Related Content

PPT
Excel 2007- Enter Formulas
PDF
Экономика продуктов и метрики (Илья Краинский, Magic Ink)
PDF
Building servers with Node.js
PDF
Экономика и метрика проекта. Илья Красинский
PDF
Horizontally Scaling Node.js and WebSockets
PDF
Григорий Ситнин: unit-экономика проекта
PPTX
Building and Scaling Node.js Applications
Excel 2007- Enter Formulas
Экономика продуктов и метрики (Илья Краинский, Magic Ink)
Building servers with Node.js
Экономика и метрика проекта. Илья Красинский
Horizontally Scaling Node.js and WebSockets
Григорий Ситнин: unit-экономика проекта
Building and Scaling Node.js Applications

Viewers also liked (20)

PDF
Planning for the Horizontal: Scaling Node.js Applications
PDF
Anatomy of a Modern Node.js Application Architecture
ODP
Go to hell Flash, we don't need you anymore! GothamJs
PDF
Воронка продаж для интернет магазина. Методы оптимизации и наращивания продаж
PDF
Progressive Enhancement 2.0 (Conference Agnostic)
PDF
HSE{SUN}: День 1. Моисеева Анна
PPTX
HSE{SUN}: День 2. Артем Азевич
PDF
"От идеи до бизнеса. Инструменты работы с проектами" Николай Савин (Бизнес-ин...
KEY
Пять сил конкуренции М. Портера
PDF
HSE{SUN}: День 3. Вадим Малыч
PPTX
М. Нальский: Как влюбить клиента в b2b-продукт?
PPTX
Олег Громов: конкурентный анализ для стартапов
PDF
HSE{SUN}: День 4. Сергей Голубев
PDF
Dark patterns - An Overview for Brand Owners
KEY
Sass: The Future of Stylesheets
PDF
hse{sun} Экономика стартапа и метрики: как помочь проекту найти цель и эффект...
PPT
Scalability using Node.js
PDF
Стратегический подход к маркетингу в социальных медиа (c) Михаил Гейшерик
PDF
jQuery Proven Performance Tips & Tricks
KEY
Object Oriented CSS
Planning for the Horizontal: Scaling Node.js Applications
Anatomy of a Modern Node.js Application Architecture
Go to hell Flash, we don't need you anymore! GothamJs
Воронка продаж для интернет магазина. Методы оптимизации и наращивания продаж
Progressive Enhancement 2.0 (Conference Agnostic)
HSE{SUN}: День 1. Моисеева Анна
HSE{SUN}: День 2. Артем Азевич
"От идеи до бизнеса. Инструменты работы с проектами" Николай Савин (Бизнес-ин...
Пять сил конкуренции М. Портера
HSE{SUN}: День 3. Вадим Малыч
М. Нальский: Как влюбить клиента в b2b-продукт?
Олег Громов: конкурентный анализ для стартапов
HSE{SUN}: День 4. Сергей Голубев
Dark patterns - An Overview for Brand Owners
Sass: The Future of Stylesheets
hse{sun} Экономика стартапа и метрики: как помочь проекту найти цель и эффект...
Scalability using Node.js
Стратегический подход к маркетингу в социальных медиа (c) Михаил Гейшерик
jQuery Proven Performance Tips & Tricks
Object Oriented CSS
Ad

Similar to A million connections and beyond - Node.js at scale (20)

PPTX
Node.js: A Guided Tour
PPTX
PPTX
Introduction to Node.js
PDF
Understanding the Single Thread Event Loop
PPT
Node js
PDF
Best node js course
PPTX
PPTX
Beginners Node.js
PPT
Node.js: CAMTA Presentation
PPT
Overview Of Parallel Development - Ericnel
PPTX
Kalp Corporate Node JS Perfect Guide
PDF
Developing realtime apps with Drupal and NodeJS
PPTX
An overview of node.js
PPTX
Node.js meetup 17.05.2017 ember.js - escape the javascript fatigue
ODP
Introduce about Nodejs - duyetdev.com
PPTX
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
PPTX
Introduction to Node.JS
PDF
[판교에서 만나는 아마존웹서비스] Obama for America를 통해서 본 AWS에서의 데이터 분석
PPTX
KEY
node.js: Javascript's in your backend
Node.js: A Guided Tour
Introduction to Node.js
Understanding the Single Thread Event Loop
Node js
Best node js course
Beginners Node.js
Node.js: CAMTA Presentation
Overview Of Parallel Development - Ericnel
Kalp Corporate Node JS Perfect Guide
Developing realtime apps with Drupal and NodeJS
An overview of node.js
Node.js meetup 17.05.2017 ember.js - escape the javascript fatigue
Introduce about Nodejs - duyetdev.com
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
Introduction to Node.JS
[판교에서 만나는 아마존웹서비스] Obama for America를 통해서 본 AWS에서의 데이터 분석
node.js: Javascript's in your backend
Ad

More from Tom Croucher (20)

PDF
Using Node.js to Build Great Streaming Services - HTML5 Dev Conf
KEY
Streams are Awesome - (Node.js) TimesOpen Sep 2012
KEY
Using Node.js to improve the performance of Mobile apps and Mobile web
KEY
Writing robust Node.js applications
KEY
Creating the Internet of Things with JavaScript - Fluent Conf
KEY
Using Node.js to make HTML5 work for everyone
KEY
OSCON 2011 - Node.js Tutorial
PDF
Lessons from a coding veteran - Web Directions @Media
KEY
Multi-tiered Node Architectures - JSConf 2011
KEY
A language for the Internet: Why JavaScript and Node.js is right for Internet...
KEY
A language for the Internet: Why JavaScript and Node.js is right for Internet...
PDF
How to stop writing spaghetti code
PDF
Doing Horrible Things with DNS - Web Directions South
PDF
Doing Horrible Things to DNS in the Name of Science - SF Performance Meetup
PDF
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
KEY
How to stop writing spaghetti code - JSConf.eu 2010
PDF
Sf perf
PDF
Node.js and How JavaScript is Changing Server Programming
PDF
Server Side JavaScript - You ain't seen nothing yet
PDF
JavaScript Everywhere! Creating a 100% JavaScript web stack
Using Node.js to Build Great Streaming Services - HTML5 Dev Conf
Streams are Awesome - (Node.js) TimesOpen Sep 2012
Using Node.js to improve the performance of Mobile apps and Mobile web
Writing robust Node.js applications
Creating the Internet of Things with JavaScript - Fluent Conf
Using Node.js to make HTML5 work for everyone
OSCON 2011 - Node.js Tutorial
Lessons from a coding veteran - Web Directions @Media
Multi-tiered Node Architectures - JSConf 2011
A language for the Internet: Why JavaScript and Node.js is right for Internet...
A language for the Internet: Why JavaScript and Node.js is right for Internet...
How to stop writing spaghetti code
Doing Horrible Things with DNS - Web Directions South
Doing Horrible Things to DNS in the Name of Science - SF Performance Meetup
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
How to stop writing spaghetti code - JSConf.eu 2010
Sf perf
Node.js and How JavaScript is Changing Server Programming
Server Side JavaScript - You ain't seen nothing yet
JavaScript Everywhere! Creating a 100% JavaScript web stack

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
KodekX | Application Modernization Development
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Encapsulation theory and applications.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPT
Teaching material agriculture food technology
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
cuic standard and advanced reporting.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
Per capita expenditure prediction using model stacking based on satellite ima...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Digital-Transformation-Roadmap-for-Companies.pptx
KodekX | Application Modernization Development
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Unlocking AI with Model Context Protocol (MCP)
Encapsulation theory and applications.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Teaching material agriculture food technology
NewMind AI Weekly Chronicles - August'25 Week I
Advanced methodologies resolving dimensionality complications for autism neur...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
cuic standard and advanced reporting.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
The Rise and Fall of 3GPP – Time for a Sabbatical?

A million connections and beyond - Node.js at scale

  • 1. A million connections... AND BEYOND!!! Node.js at Scale
  • 3. A million isn't very much these days...
  • 4. One hundred billion connections!!!
  • 5. What this talk is really about Picking meaningful benchmarks Current state of Node.js benchmarks Understanding why benchmarks aren't _that_ important How to pick the right language/framework/lib
  • 6. What can we measure? Computation Disk I/O Net work I/O Throughput TCP Libraries UDP URL Parsing HTTP etc
  • 7. How do we measure? Load averages Memory usage Average time - Average perf. of each operation Latency - Actual performance of each operation
  • 8. Comparison Erlang vs. Node.js vs. Tornado 3 Erlang libs Stock Node.js Stock Tornado Single core
  • 9. Desired vs. Real Responses
  • 11. I pity the fool who uses Node
  • 12. Questioning benchmarks What do average times mean? Responses on a curve Who uses in memory servers?
  • 13. Finding Node's strength connections: 933990 errors: 0 Read from remote host gqzdj9ab.joyent.us: Operation timed out Connection to gqzdj9ab.joyent.us closed. Enki:~ $
  • 14. var net = require('net') var conns = 0 function connectToServer(ip) { conn = net.createConnection(8000, ip) conn.on('connect', function() { conns += 1 }) conn.on('end', function() { conns -= 1 }) } for(i=0;i<61000;i++) { connectToServer('72.2.120.106') }
  • 15. var net = require('net') var s = net.createServer() var c = 0; var e = 0; s.on('connection', function(socket) { c += 1 socket.on('end', function() { c -= 1 }) socket.on('error', function(e) { e += 1 }) }) s.listen(8000) setInterval(function() { console.log('connections: ' + c) console.log('errors: ' + e) }, 5000)
  • 16. Finding Node's strength PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP 22593 root 758M 642M cpu11 25 0 0:17:54 6.2% node/1 22542 croucher 4308K 3084K cpu2 59 0 0:00:08 0.2% prstat/1 ... ... ZONEID NPROC SWAP RSS MEMORY TIME CPU ZONE 27 31 1489M 782M 38% 1:59:54 6.3% gqzdj9ab
  • 17. Where to use atomic measurements Measuring performance improvements over time Figuring out the hot-path Profiling against your specific use case
  • 19. I am a super stuff effective measurement Because I put stuff on one axis and things on another and now I'm like things proper science and you should totally use me to base all your judgements about everything on… no seriously...
  • 20. Why benchmarks aren't as important as we think There is a tradeoff bet ween performance and productivity If this weren't true we'd all still be writing in ASM
  • 21. Fit for purpose Sandboxed language Event Driven PHP, Python Node.js Java, C# Event Machine (Ruby) Ruby, etc Tornado (Python) Message Passing Erlang
  • 22. Class of languages for the Internet New languages/platforms like Node.js designed for Internet applications New class of languages are efficient enough, but are they easy enough? Node.js designed from scratch for net work server programming
  • 23. Reasons to use Node It's really fast. Very much fast enough. It's easy to use for Internet/Web applications. It's JavaScript. It has an extremely active community. It has a lot of project velocity.
  • 24. What we need from benchmarks Benchmarks to test real world use cases Servers that do more than just 'hello world' Benchmarks to compare real test cases from many platforms Benchmarks that reflect mobile clients Node CI on many platforms
  • 25. Questions? I'm on Twitter http:/ witter.com/sh1mmer /t That's a "one" in my nick Check out the book on http://ofps.oreilly.com It's free to read and comment. New release this week

Editor's Notes