SlideShare a Scribd company logo
Scaling node.js apps
@akts – 2018/03/16
What is scaling ?
app dbInternet
● Availability.
● Tolerance to failure.
● Share workload.
A simple solution
app 1 db
Internet
app 3
app 0
app 2
Load
balancer
node.js
● Single threaded - can only use one core of our CPU - ( Bad )
● Non-blocking – God bless the event loop ! – ( Good )
● Modules for scalability baked into the run-time - ( Awesome )
Things we can do
● Clonning:
● Clone app multiple times.
● Each cloned instance handles part of the load.
● Minimum strategy – low development time, highly effective.
● The infamous cluster module.
● Decomposing:
● Multiple, different applications with different code bases
● They might even score dedicated DBs and UIs
● Microservice – service should be as small as possible (Not really)
● Not easy, unexpected problems
● Splitting:
● Split into multiple instances, each instance for part of app data
● Horizontal partitioning / sharding
● Requires lookup logic
The cluster module
Master
w1 w2 w3 w4
Server
Round robin – Priorities - Least Loaded
· · ·
Useful for deploying to single machines
Let’s use it – Demo Time
● Have apache bench, siege or any other load test tool.
$ sudo apt install apache2-utils siege
● 200 concurrent users for 10 seconds
● Load-Balancing an HTTP Server
● Broadcasting Messages to All Workers
● Increasing Server Availability
● Zero-downtime Restarts
● An ode to PM2
$ sudo npm install -g pm2
$ pm2 start server.js -i max
$ pm2 reload all
● Shared State and Sticky Load Balancing
That’s all folks
● https://medium.freecodecamp.org/scaling-node-js-applications-8492bd8afadc - literally this presentation
● https://medium.freecodecamp.org/node-js-child-processes-everything-you-need-to-know-e69498fe970a
● https://www.youtube.com/watch?v=w1IzRF6AkuI
References a.k.a People I ripped off for this presentation
☮ ♡

More Related Content

What's hot

Jimmy Tang - Deploying with Ansible
Jimmy Tang - Deploying with AnsibleJimmy Tang - Deploying with Ansible
Jimmy Tang - Deploying with Ansible
dri_ireland
 
Angular + JHipster - JHipster Conf
Angular + JHipster - JHipster ConfAngular + JHipster - JHipster Conf
Angular + JHipster - JHipster Conf
William Marques
 
Amazon Web Services lection 6
Amazon Web Services lection 6  Amazon Web Services lection 6
Amazon Web Services lection 6
Binary Studio
 
Containerization - The DevOps Revolution
Containerization - The DevOps RevolutionContainerization - The DevOps Revolution
Containerization - The DevOps RevolutionYulian Slobodyan
 
How to achieve scalable environments using kubernetes and vmss on azure cloud
How to achieve scalable environments using kubernetes and vmss on azure cloudHow to achieve scalable environments using kubernetes and vmss on azure cloud
How to achieve scalable environments using kubernetes and vmss on azure cloud
Noam Shochat
 
Akka Actors and Clustering
Akka Actors and ClusteringAkka Actors and Clustering
Akka Actors and Clustering
ismet özöztürk
 
CD, docker and kubernetes
CD, docker and  kubernetesCD, docker and  kubernetes
CD, docker and kubernetes
Martin Podval
 
Load testing with gatling
Load testing with gatlingLoad testing with gatling
Load testing with gatlingChris Birchall
 
Amazon Web Services lection 2
Amazon Web Services lection 2Amazon Web Services lection 2
Amazon Web Services lection 2
Binary Studio
 
Civil War: LXD vs Docker
Civil War: LXD vs DockerCivil War: LXD vs Docker
Civil War: LXD vs Docker
OpenNebula Project
 
OpenNebula 5.4 Enhancements vCenter Integration
OpenNebula 5.4 Enhancements vCenter IntegrationOpenNebula 5.4 Enhancements vCenter Integration
OpenNebula 5.4 Enhancements vCenter Integration
OpenNebula Project
 
OpenNebulaconf2017US: Vtastic:Akamai innovations for distributed system testi...
OpenNebulaconf2017US: Vtastic:Akamai innovations for distributed system testi...OpenNebulaconf2017US: Vtastic:Akamai innovations for distributed system testi...
OpenNebulaconf2017US: Vtastic:Akamai innovations for distributed system testi...
OpenNebula Project
 
Apache pulsar
Apache pulsarApache pulsar
Apache pulsar
Kotireddy Sareddy
 
Anton Boyko "The future of serverless computing"
Anton Boyko "The future of serverless computing"Anton Boyko "The future of serverless computing"
Anton Boyko "The future of serverless computing"
Fwdays
 
Mobile 3: Launch Like a Boss!
Mobile 3: Launch Like a Boss!Mobile 3: Launch Like a Boss!
Mobile 3: Launch Like a Boss!
MongoDB
 
Automating using Ansible
Automating using AnsibleAutomating using Ansible
Automating using Ansible
Alok Patra
 
MySQL Multi-Master Replication
MySQL Multi-Master ReplicationMySQL Multi-Master Replication
MySQL Multi-Master Replication
Michael Naumov
 
Anton Boyko, "The evolution of microservices platform or marketing gibberish"
Anton Boyko, "The evolution of microservices platform or marketing gibberish"Anton Boyko, "The evolution of microservices platform or marketing gibberish"
Anton Boyko, "The evolution of microservices platform or marketing gibberish"
Sigma Software
 

What's hot (19)

Jimmy Tang - Deploying with Ansible
Jimmy Tang - Deploying with AnsibleJimmy Tang - Deploying with Ansible
Jimmy Tang - Deploying with Ansible
 
Angular + JHipster - JHipster Conf
Angular + JHipster - JHipster ConfAngular + JHipster - JHipster Conf
Angular + JHipster - JHipster Conf
 
Amazon Web Services lection 6
Amazon Web Services lection 6  Amazon Web Services lection 6
Amazon Web Services lection 6
 
Containerization - The DevOps Revolution
Containerization - The DevOps RevolutionContainerization - The DevOps Revolution
Containerization - The DevOps Revolution
 
How to achieve scalable environments using kubernetes and vmss on azure cloud
How to achieve scalable environments using kubernetes and vmss on azure cloudHow to achieve scalable environments using kubernetes and vmss on azure cloud
How to achieve scalable environments using kubernetes and vmss on azure cloud
 
Akka Actors and Clustering
Akka Actors and ClusteringAkka Actors and Clustering
Akka Actors and Clustering
 
CD, docker and kubernetes
CD, docker and  kubernetesCD, docker and  kubernetes
CD, docker and kubernetes
 
Load testing with gatling
Load testing with gatlingLoad testing with gatling
Load testing with gatling
 
Amazon Web Services lection 2
Amazon Web Services lection 2Amazon Web Services lection 2
Amazon Web Services lection 2
 
Civil War: LXD vs Docker
Civil War: LXD vs DockerCivil War: LXD vs Docker
Civil War: LXD vs Docker
 
OpenNebula 5.4 Enhancements vCenter Integration
OpenNebula 5.4 Enhancements vCenter IntegrationOpenNebula 5.4 Enhancements vCenter Integration
OpenNebula 5.4 Enhancements vCenter Integration
 
OpenNebulaconf2017US: Vtastic:Akamai innovations for distributed system testi...
OpenNebulaconf2017US: Vtastic:Akamai innovations for distributed system testi...OpenNebulaconf2017US: Vtastic:Akamai innovations for distributed system testi...
OpenNebulaconf2017US: Vtastic:Akamai innovations for distributed system testi...
 
Apache pulsar
Apache pulsarApache pulsar
Apache pulsar
 
Anton Boyko "The future of serverless computing"
Anton Boyko "The future of serverless computing"Anton Boyko "The future of serverless computing"
Anton Boyko "The future of serverless computing"
 
Mobile 3: Launch Like a Boss!
Mobile 3: Launch Like a Boss!Mobile 3: Launch Like a Boss!
Mobile 3: Launch Like a Boss!
 
Automating using Ansible
Automating using AnsibleAutomating using Ansible
Automating using Ansible
 
MySQL Multi-Master Replication
MySQL Multi-Master ReplicationMySQL Multi-Master Replication
MySQL Multi-Master Replication
 
Anton Boyko, "The evolution of microservices platform or marketing gibberish"
Anton Boyko, "The evolution of microservices platform or marketing gibberish"Anton Boyko, "The evolution of microservices platform or marketing gibberish"
Anton Boyko, "The evolution of microservices platform or marketing gibberish"
 
Amazon Cloud Overview
Amazon Cloud OverviewAmazon Cloud Overview
Amazon Cloud Overview
 

Similar to Neoito — Scaling node.js

Microservice Workshop Hands On
Microservice Workshop Hands On Microservice Workshop Hands On
Microservice Workshop Hands On
Ram G Suri
 
[WSO2Con Asia 2018] Architecting for Container-native Environments
[WSO2Con Asia 2018] Architecting for Container-native Environments[WSO2Con Asia 2018] Architecting for Container-native Environments
[WSO2Con Asia 2018] Architecting for Container-native Environments
WSO2
 
WillMicroserviceDie.pdf
WillMicroserviceDie.pdfWillMicroserviceDie.pdf
WillMicroserviceDie.pdf
EmilyJiang23
 
Build A Scalable Mobile App
Build A Scalable Mobile App Build A Scalable Mobile App
Build A Scalable Mobile App
Mohamed Aboul-Fotouh
 
Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!
pflueras
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadKrivoy Rog IT Community
 
Mini-Training: Node.js
Mini-Training: Node.jsMini-Training: Node.js
Mini-Training: Node.js
Betclic Everest Group Tech Team
 
Real World AngularJS recipes: beyond TodoMVC
Real World AngularJS recipes: beyond TodoMVCReal World AngularJS recipes: beyond TodoMVC
Real World AngularJS recipes: beyond TodoMVC
Carlo Bonamico
 
Real World AngularJS recipes: beyond TodoMVC - Carlo Bonamico, Sonia Pini - C...
Real World AngularJS recipes: beyond TodoMVC - Carlo Bonamico, Sonia Pini - C...Real World AngularJS recipes: beyond TodoMVC - Carlo Bonamico, Sonia Pini - C...
Real World AngularJS recipes: beyond TodoMVC - Carlo Bonamico, Sonia Pini - C...
Codemotion
 
Truemotion Adventures in Containerization
Truemotion Adventures in ContainerizationTruemotion Adventures in Containerization
Truemotion Adventures in Containerization
Ryan Hunter
 
Secrets of Spark's success - Deenar Toraskar, Think Reactive
Secrets of Spark's success - Deenar Toraskar, Think Reactive Secrets of Spark's success - Deenar Toraskar, Think Reactive
Secrets of Spark's success - Deenar Toraskar, Think Reactive
huguk
 
Container basics
Container basicsContainer basics
Container basics
Manoj Chandran
 
Node.js Presentation
Node.js PresentationNode.js Presentation
Node.js Presentation
Exist
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
Dmytro Semenov
 
Microcontainers, Microservices, Microservers? Less [Linux] is more!
Microcontainers, Microservices, Microservers? Less [Linux] is more!Microcontainers, Microservices, Microservers? Less [Linux] is more!
Microcontainers, Microservices, Microservers? Less [Linux] is more!
Dermot Bradley
 
Public Cloud Workshop
Public Cloud WorkshopPublic Cloud Workshop
Public Cloud Workshop
Amer Ather
 
MEAN Inside out (with AngularX)
MEAN Inside out (with AngularX)MEAN Inside out (with AngularX)
MEAN Inside out (with AngularX)
paolokersey
 
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JSFestUA
 
A docker love story
A docker love storyA docker love story
A docker love story
Brian de Heus
 
JSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontendJSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontend
Vlad Fedosov
 

Similar to Neoito — Scaling node.js (20)

Microservice Workshop Hands On
Microservice Workshop Hands On Microservice Workshop Hands On
Microservice Workshop Hands On
 
[WSO2Con Asia 2018] Architecting for Container-native Environments
[WSO2Con Asia 2018] Architecting for Container-native Environments[WSO2Con Asia 2018] Architecting for Container-native Environments
[WSO2Con Asia 2018] Architecting for Container-native Environments
 
WillMicroserviceDie.pdf
WillMicroserviceDie.pdfWillMicroserviceDie.pdf
WillMicroserviceDie.pdf
 
Build A Scalable Mobile App
Build A Scalable Mobile App Build A Scalable Mobile App
Build A Scalable Mobile App
 
Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!Migrate to Microservices Judiciously!
Migrate to Microservices Judiciously!
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
 
Mini-Training: Node.js
Mini-Training: Node.jsMini-Training: Node.js
Mini-Training: Node.js
 
Real World AngularJS recipes: beyond TodoMVC
Real World AngularJS recipes: beyond TodoMVCReal World AngularJS recipes: beyond TodoMVC
Real World AngularJS recipes: beyond TodoMVC
 
Real World AngularJS recipes: beyond TodoMVC - Carlo Bonamico, Sonia Pini - C...
Real World AngularJS recipes: beyond TodoMVC - Carlo Bonamico, Sonia Pini - C...Real World AngularJS recipes: beyond TodoMVC - Carlo Bonamico, Sonia Pini - C...
Real World AngularJS recipes: beyond TodoMVC - Carlo Bonamico, Sonia Pini - C...
 
Truemotion Adventures in Containerization
Truemotion Adventures in ContainerizationTruemotion Adventures in Containerization
Truemotion Adventures in Containerization
 
Secrets of Spark's success - Deenar Toraskar, Think Reactive
Secrets of Spark's success - Deenar Toraskar, Think Reactive Secrets of Spark's success - Deenar Toraskar, Think Reactive
Secrets of Spark's success - Deenar Toraskar, Think Reactive
 
Container basics
Container basicsContainer basics
Container basics
 
Node.js Presentation
Node.js PresentationNode.js Presentation
Node.js Presentation
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
 
Microcontainers, Microservices, Microservers? Less [Linux] is more!
Microcontainers, Microservices, Microservers? Less [Linux] is more!Microcontainers, Microservices, Microservers? Less [Linux] is more!
Microcontainers, Microservices, Microservers? Less [Linux] is more!
 
Public Cloud Workshop
Public Cloud WorkshopPublic Cloud Workshop
Public Cloud Workshop
 
MEAN Inside out (with AngularX)
MEAN Inside out (with AngularX)MEAN Inside out (with AngularX)
MEAN Inside out (with AngularX)
 
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
 
A docker love story
A docker love storyA docker love story
A docker love story
 
JSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontendJSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontend
 

More from Neoito

Neoito — NativeScript Best Coding Practices
Neoito — NativeScript Best Coding PracticesNeoito — NativeScript Best Coding Practices
Neoito — NativeScript Best Coding Practices
Neoito
 
Neoito — *NIX kungfu for web devs
Neoito — *NIX kungfu for web devsNeoito — *NIX kungfu for web devs
Neoito — *NIX kungfu for web devs
Neoito
 
Neoito — Secure coding practices
Neoito — Secure coding practicesNeoito — Secure coding practices
Neoito — Secure coding practices
Neoito
 
Neoito — How modern browsers work
Neoito — How modern browsers workNeoito — How modern browsers work
Neoito — How modern browsers work
Neoito
 
Neoito — React 101
Neoito — React 101Neoito — React 101
Neoito — React 101
Neoito
 
Neoito — Grid layout
Neoito — Grid layoutNeoito — Grid layout
Neoito — Grid layout
Neoito
 
Neoito — Software licensing
Neoito — Software licensingNeoito — Software licensing
Neoito — Software licensing
Neoito
 
Neoito — GitLab for project management
Neoito — GitLab for project managementNeoito — GitLab for project management
Neoito — GitLab for project management
Neoito
 
Neoito — Routing and navigation in Angular
Neoito — Routing and navigation in AngularNeoito — Routing and navigation in Angular
Neoito — Routing and navigation in Angular
Neoito
 
Neoito — Animations in Angular 5
Neoito — Animations in Angular 5Neoito — Animations in Angular 5
Neoito — Animations in Angular 5
Neoito
 
Neoito — A roadmap to Angular
Neoito — A roadmap to AngularNeoito — A roadmap to Angular
Neoito — A roadmap to Angular
Neoito
 
Neoito — Intro to WebSockets
Neoito — Intro to WebSocketsNeoito — Intro to WebSockets
Neoito — Intro to WebSockets
Neoito
 
Neoito — Typography for the web
Neoito — Typography for the webNeoito — Typography for the web
Neoito — Typography for the web
Neoito
 
Neoito — Design patterns and depenedency injection
Neoito — Design patterns and depenedency injectionNeoito — Design patterns and depenedency injection
Neoito — Design patterns and depenedency injection
Neoito
 

More from Neoito (14)

Neoito — NativeScript Best Coding Practices
Neoito — NativeScript Best Coding PracticesNeoito — NativeScript Best Coding Practices
Neoito — NativeScript Best Coding Practices
 
Neoito — *NIX kungfu for web devs
Neoito — *NIX kungfu for web devsNeoito — *NIX kungfu for web devs
Neoito — *NIX kungfu for web devs
 
Neoito — Secure coding practices
Neoito — Secure coding practicesNeoito — Secure coding practices
Neoito — Secure coding practices
 
Neoito — How modern browsers work
Neoito — How modern browsers workNeoito — How modern browsers work
Neoito — How modern browsers work
 
Neoito — React 101
Neoito — React 101Neoito — React 101
Neoito — React 101
 
Neoito — Grid layout
Neoito — Grid layoutNeoito — Grid layout
Neoito — Grid layout
 
Neoito — Software licensing
Neoito — Software licensingNeoito — Software licensing
Neoito — Software licensing
 
Neoito — GitLab for project management
Neoito — GitLab for project managementNeoito — GitLab for project management
Neoito — GitLab for project management
 
Neoito — Routing and navigation in Angular
Neoito — Routing and navigation in AngularNeoito — Routing and navigation in Angular
Neoito — Routing and navigation in Angular
 
Neoito — Animations in Angular 5
Neoito — Animations in Angular 5Neoito — Animations in Angular 5
Neoito — Animations in Angular 5
 
Neoito — A roadmap to Angular
Neoito — A roadmap to AngularNeoito — A roadmap to Angular
Neoito — A roadmap to Angular
 
Neoito — Intro to WebSockets
Neoito — Intro to WebSocketsNeoito — Intro to WebSockets
Neoito — Intro to WebSockets
 
Neoito — Typography for the web
Neoito — Typography for the webNeoito — Typography for the web
Neoito — Typography for the web
 
Neoito — Design patterns and depenedency injection
Neoito — Design patterns and depenedency injectionNeoito — Design patterns and depenedency injection
Neoito — Design patterns and depenedency injection
 

Recently uploaded

Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 

Recently uploaded (20)

Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 

Neoito — Scaling node.js

  • 1. Scaling node.js apps @akts – 2018/03/16
  • 2. What is scaling ? app dbInternet ● Availability. ● Tolerance to failure. ● Share workload.
  • 3. A simple solution app 1 db Internet app 3 app 0 app 2 Load balancer
  • 4. node.js ● Single threaded - can only use one core of our CPU - ( Bad ) ● Non-blocking – God bless the event loop ! – ( Good ) ● Modules for scalability baked into the run-time - ( Awesome )
  • 5. Things we can do ● Clonning: ● Clone app multiple times. ● Each cloned instance handles part of the load. ● Minimum strategy – low development time, highly effective. ● The infamous cluster module. ● Decomposing: ● Multiple, different applications with different code bases ● They might even score dedicated DBs and UIs ● Microservice – service should be as small as possible (Not really) ● Not easy, unexpected problems ● Splitting: ● Split into multiple instances, each instance for part of app data ● Horizontal partitioning / sharding ● Requires lookup logic
  • 6. The cluster module Master w1 w2 w3 w4 Server Round robin – Priorities - Least Loaded · · · Useful for deploying to single machines
  • 7. Let’s use it – Demo Time ● Have apache bench, siege or any other load test tool. $ sudo apt install apache2-utils siege ● 200 concurrent users for 10 seconds ● Load-Balancing an HTTP Server ● Broadcasting Messages to All Workers ● Increasing Server Availability ● Zero-downtime Restarts ● An ode to PM2 $ sudo npm install -g pm2 $ pm2 start server.js -i max $ pm2 reload all ● Shared State and Sticky Load Balancing
  • 8. That’s all folks ● https://medium.freecodecamp.org/scaling-node-js-applications-8492bd8afadc - literally this presentation ● https://medium.freecodecamp.org/node-js-child-processes-everything-you-need-to-know-e69498fe970a ● https://www.youtube.com/watch?v=w1IzRF6AkuI References a.k.a People I ripped off for this presentation ☮ ♡