SlideShare a Scribd company logo
1 of 35
Download to read offline
Placar UOL
• JavaScript desde 1999
• Node.js desde v0.2.4 (2010)
• 15 anos no UOL
Home Page, Rádio UOL
Publicador (CMS), Bate-papo
Busca, Placar UOL
TSE
“tempo-real”
publica assina
editaassiste envia
Alta audiência
em intervalo de
tempo
extrema-
mente curto
HTTP REQ/RES
CONN/THREAD
1m UPDATENFS + mod_cacheMETA REFRESH
30.000
18
30/06/2006
DEVOPS++
4s UPDATERESTARTSJSONP
SCRIPT
72.000
18
Rio 2011
1s UPDATEPROXYJSON/XHR
SOCKETS * 2MOD--
500.000
18
Rio 2013
BIDIRECIONAL TCP HANDSHAKE
$ npm install ws
https://github.com/websockets/ws
The fastest RFC-6455 WebSocket
implementation for Node.js
BINARY HIXIE
User
DNS
Router
Master
Data centers Servers Processes
Worker
Internet
Browser
Arquitetura
Workers
theory
meets messy reality
most connections ended up in just two
or three processes.
https://strongloop.com/strongblog/whats-new-in-node-js-v0-12-cluster-round-robin-load-balancing/
iptables
iptables -A PREROUTING -i eth1+ -p tcp -m tcp --dport 80 -m statistic --mode nth --every 23 -j REDIRECT --to-ports 8103
iptables -A PREROUTING -i eth1+ -p tcp -m tcp --dport 80 -m statistic --mode nth --every 22 -j REDIRECT --to-ports 8102
iptables -A PREROUTING -i eth1+ -p tcp -m tcp --dport 80 -m statistic --mode nth --every 21 -j REDIRECT --to-ports 8101
iptables -A PREROUTING -i eth1+ -p tcp -m tcp --dport 80 -m statistic --mode nth --every 20 -j REDIRECT --to-ports 8100
iptables -A PREROUTING -i eth1+ -p tcp -m tcp --dport 80 -m statistic --mode nth --every 19 -j REDIRECT --to-ports 8099
iptables -A PREROUTING -i eth1+ -p tcp -m tcp --dport 80 -m statistic --mode nth --every 18 -j REDIRECT --to-ports 8098
iptables -A PREROUTING -i eth1+ -p tcp -m tcp --dport 80 -m statistic --mode nth --every 17 -j REDIRECT --to-ports 8097
iptables -A PREROUTING -i eth1+ -p tcp -m tcp --dport 80 -m statistic --mode nth --every 16 -j REDIRECT --to-ports 8096
iptables -A PREROUTING -i eth1+ -p tcp -m tcp --dport 80 -m statistic --mode nth --every 15 -j REDIRECT --to-ports 8095
child_process
32 cores (2 GHz)
64 GB RAM
31 workers
REDE 1 Gb USO PREVISÍVEL
CRESCIMENTO
HORIZONTAL
1.040.000 users
33.500 users / worker
TOO BIG TO FAIL
16.700 users / GB
4 cores (2.2 GHz)
8 GB RAM
3 workers
100.000 users
33.300 users / worker
16.600 users / GB
(Des)balanceamento via DNS
close code 4001
WebSocket close codes 4000-4999
“Available for use by applications”
RAM NOK
BROWSER DNS DATA CENTER SERVER
WebSocket HTTP upgrade
POLLING!
HUEHUEHUE 46 LINHAS 2s
1.200.000
26
24 milhões de page views
300.000
26
3,5 milhões de page views
1 x 7 never forget
1.100.000
26
Primeiro turno
1.500.000
26
Segundo turno
ms UPDATEPOLLING IE
window.WebSocket
DEVOPS--
PING
RESTART = 0
Obrigado!
fermads@uolinc.com

More Related Content

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Featured (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Placar UOL: Copa do Mundo e Eleições ao vivo com Node.js e WebSockets