SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
I ❤ HAProxy
National Airspace System - FAA
Simplified Web Architecture
             Web
Clients                Dynamic    “Data”
            Server

                         PHP      Memcache
 iPhones     Nginx
                                  PostgreSQL
                         Ruby
                                   MySQL
 Androids   Apache       Perl      Mongo
                                  CouchDB
                        Python
                                    Redis
 Browsers   lighttpd
                        Node.js    Oracle
ChOP Archtiecture
            Web
Clients             Dynamic     “Data”
           Server

                                Memcache
 iPhone

                                 MySQL
 Android    Nginx    PHP5-FPM
                                  Redis

 Desktop
                                  Chat
YouVersion Architecture
            Web
Clients             Dynamic     “Data”
           Server

                                Memcache
 iPhone
                     PHP5-FPM
                                PostgreSQL
 Android    Nginx
                                 Mongo
                       Ruby
                     (coming
 Desktop               soon)
                                 Oracle
HAProxy
¡  High Availability Proxy

¡  TCP load balancing proxy with awesome health
    checking built in

¡  Fast

¡  Scalable

¡  Makes non-HA services HA
How I Love Thee, Let Me
Count The Ways…
¡  Rock solid

¡  Dead simple to run and configure

¡  Comprehensive Health Checking

¡  Lots of statistics
HAProxy Uses
¡  Not really a service unto itself

¡  Fits into the gaps between layers well

¡  Issue: Becomes a single point of failure itself


      HAProxy        HAProxy*          HAProxy*


                 Web         Dynamic
Clients                                      “Data”
                Server        Engine

                              * – potential future use
Eliminating SPOFs
¡  Two types of HAProxy SPOFs:
 ¡  Service Outage
     (Hardware failure or HAProxy service failure)
 ¡  HAProxy Limit Outage / Upstream Outage
     (Hit some arbitrary limit we defined somewhere or
     ran out of some slots somewhere)
Service Outage
¡  HAProxy service crashes or dies for some reason
    (has never happened, knock on wood)

¡  Hardware / Network Failure
Service Outage: Solution
¡  Corosync & Pacemaker

¡  Hard to configure at first, but don’t really need to
    touch it later

¡  Pretty much magic

¡  Two Corosync HAProxy clusters: DFW and SAN

¡  Setup is blogged about here:
    http://itand.me/41901523
HAProxy Limit Outage /
Upstream Outage
¡  Usually because of an outage further upstream
    at the Dynamic or “Data” layer

¡  Completely Hypothetical Situation: Mongo slows
    down, causing PHP processes to back up,
    causing the connection limit to go through the
    roof, causing total outage
What it looks like on the
graph (Yesterday)




OR: WHY WE MUST MOVE MONGO STAT!
For ChOP (Chat), it’s a little
different…
Upstream Outage
¡  Usually the result of running out of PHP processes.

¡  Normally each PHP process can process
    hundreds of req/s

¡  Something slows them down (mongo, postgres,
    et al) so a process can only process a smaller
    number of req / s (or, worse, seconds / req)

¡  Inevitably, these requests take all PHP processes,
    nothing else can run and HAProxy fails all health
    checks and shows you Binary Jesus
“Solutions”
¡  Start Hashing URLs to avoid upstream failures
 ¡  Want to send all URL requests to the same app server
     so if it’s slow only that app server goes down
 ¡  Some benefit to caching as well
 ¡  Challenge: want to hash only part of a URL
 ¡  Challenge: need to separate app servers into
     “availability groups”
 ¡  Challenge: deployments, monitoring, alerting, all
     that crap…
HAProxy Limit Outage
¡  We set limits on all HAProxy backends and front
    ends and servers to ensure they don’t get
    overwhelmed

¡  Sometimes these limits are too low

¡  Solution: Raise them

¡  Challenge: Raise them too high without regard
    for the backend, and you could cause more
    harm than good (Stampeding Herd)
Q&A

Más contenido relacionado

La actualidad más candente

Web Server Load Balancer
Web Server Load BalancerWeb Server Load Balancer
Web Server Load BalancerMobME Technical
 
HA Proxy logs - The Art of Logging
HA Proxy logs - The Art of LoggingHA Proxy logs - The Art of Logging
HA Proxy logs - The Art of Logginglogmatic.io
 
Load Balancing MySQL with HAProxy - Slides
Load Balancing MySQL with HAProxy - SlidesLoad Balancing MySQL with HAProxy - Slides
Load Balancing MySQL with HAProxy - SlidesSeveralnines
 
Introduction to Haproxy
Introduction to HaproxyIntroduction to Haproxy
Introduction to HaproxyShaopeng He
 
How To Set Up SQL Load Balancing with HAProxy - Slides
How To Set Up SQL Load Balancing with HAProxy - SlidesHow To Set Up SQL Load Balancing with HAProxy - Slides
How To Set Up SQL Load Balancing with HAProxy - SlidesSeveralnines
 
Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1PacSecJP
 
Attacking http2 implementations (1)
Attacking http2 implementations (1)Attacking http2 implementations (1)
Attacking http2 implementations (1)John Villamil
 
HTTP2:新的机遇与挑战
HTTP2:新的机遇与挑战HTTP2:新的机遇与挑战
HTTP2:新的机遇与挑战Jerry Qu
 
HTTP 2.0 – What do I need to know?
HTTP 2.0 – What do I need to know? HTTP 2.0 – What do I need to know?
HTTP 2.0 – What do I need to know? Sigma Software
 
Kea DHCP – the new open source DHCP server from ISC
Kea DHCP – the new open source DHCP server from ISCKea DHCP – the new open source DHCP server from ISC
Kea DHCP – the new open source DHCP server from ISCMen and Mice
 
Varnish Configuration Step by Step
Varnish Configuration Step by StepVarnish Configuration Step by Step
Varnish Configuration Step by StepKim Stefan Lindholm
 
Apache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validationsApache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validationsJean-Frederic Clere
 
Apache Traffic Server & Lua
Apache Traffic Server & LuaApache Traffic Server & Lua
Apache Traffic Server & LuaKit Chan
 
Revisiting HTTP/2
Revisiting HTTP/2Revisiting HTTP/2
Revisiting HTTP/2Fastly
 
Apache Performance Tuning: Scaling Up
Apache Performance Tuning: Scaling UpApache Performance Tuning: Scaling Up
Apache Performance Tuning: Scaling UpSander Temme
 

La actualidad más candente (19)

Web Server Load Balancer
Web Server Load BalancerWeb Server Load Balancer
Web Server Load Balancer
 
HA Proxy logs - The Art of Logging
HA Proxy logs - The Art of LoggingHA Proxy logs - The Art of Logging
HA Proxy logs - The Art of Logging
 
Observability with HAProxy
Observability with HAProxyObservability with HAProxy
Observability with HAProxy
 
What's New in HAProxy
What's New in HAProxyWhat's New in HAProxy
What's New in HAProxy
 
Load Balancing MySQL with HAProxy - Slides
Load Balancing MySQL with HAProxy - SlidesLoad Balancing MySQL with HAProxy - Slides
Load Balancing MySQL with HAProxy - Slides
 
Introduction to Haproxy
Introduction to HaproxyIntroduction to Haproxy
Introduction to Haproxy
 
How To Set Up SQL Load Balancing with HAProxy - Slides
How To Set Up SQL Load Balancing with HAProxy - SlidesHow To Set Up SQL Load Balancing with HAProxy - Slides
How To Set Up SQL Load Balancing with HAProxy - Slides
 
Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1Stuart Larsen, attacking http2implementations-rev1
Stuart Larsen, attacking http2implementations-rev1
 
Attacking http2 implementations (1)
Attacking http2 implementations (1)Attacking http2 implementations (1)
Attacking http2 implementations (1)
 
HTTP2:新的机遇与挑战
HTTP2:新的机遇与挑战HTTP2:新的机遇与挑战
HTTP2:新的机遇与挑战
 
HTTP 2.0 – What do I need to know?
HTTP 2.0 – What do I need to know? HTTP 2.0 – What do I need to know?
HTTP 2.0 – What do I need to know?
 
Kea DHCP – the new open source DHCP server from ISC
Kea DHCP – the new open source DHCP server from ISCKea DHCP – the new open source DHCP server from ISC
Kea DHCP – the new open source DHCP server from ISC
 
Varnish Configuration Step by Step
Varnish Configuration Step by StepVarnish Configuration Step by Step
Varnish Configuration Step by Step
 
Apache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validationsApache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validations
 
ReplacingSquidWithATS
ReplacingSquidWithATSReplacingSquidWithATS
ReplacingSquidWithATS
 
Load balancing at tuenti
Load balancing at tuentiLoad balancing at tuenti
Load balancing at tuenti
 
Apache Traffic Server & Lua
Apache Traffic Server & LuaApache Traffic Server & Lua
Apache Traffic Server & Lua
 
Revisiting HTTP/2
Revisiting HTTP/2Revisiting HTTP/2
Revisiting HTTP/2
 
Apache Performance Tuning: Scaling Up
Apache Performance Tuning: Scaling UpApache Performance Tuning: Scaling Up
Apache Performance Tuning: Scaling Up
 

Destacado

Velocity 2011 - Our first DDoS attack
Velocity 2011 - Our first DDoS attackVelocity 2011 - Our first DDoS attack
Velocity 2011 - Our first DDoS attackCosimo Streppone
 
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a MonthUSENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a MonthNicolas Brousse
 
VarnaConf - Blue/Green Deployments with Docker, haproxy and Consul
VarnaConf - Blue/Green Deployments with Docker, haproxy and ConsulVarnaConf - Blue/Green Deployments with Docker, haproxy and Consul
VarnaConf - Blue/Green Deployments with Docker, haproxy and Consulzeridon
 
Aniki - The ORM as our great brother.
Aniki - The ORM as our great brother.Aniki - The ORM as our great brother.
Aniki - The ORM as our great brother.karupanerura
 
From pets to cattle - powered by CoreOS, docker, Mesos & nginx
From pets to cattle - powered by CoreOS, docker, Mesos & nginxFrom pets to cattle - powered by CoreOS, docker, Mesos & nginx
From pets to cattle - powered by CoreOS, docker, Mesos & nginxQAware GmbH
 
Tuning TCP and NGINX on EC2
Tuning TCP and NGINX on EC2Tuning TCP and NGINX on EC2
Tuning TCP and NGINX on EC2Chartbeat
 
NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and TuningNGINX, Inc.
 
Keepalived & HA-Proxy as an alternative to commercial loadbalancer - August 2014
Keepalived & HA-Proxy as an alternative to commercial loadbalancer - August 2014Keepalived & HA-Proxy as an alternative to commercial loadbalancer - August 2014
Keepalived & HA-Proxy as an alternative to commercial loadbalancer - August 2014inovex GmbH
 
Implementing Rolling Upgrades using Mesos, Marathon, Docker, HAProxy
Implementing Rolling Upgrades using Mesos, Marathon, Docker, HAProxyImplementing Rolling Upgrades using Mesos, Marathon, Docker, HAProxy
Implementing Rolling Upgrades using Mesos, Marathon, Docker, HAProxyVivek Juneja
 

Destacado (11)

Velocity 2011 - Our first DDoS attack
Velocity 2011 - Our first DDoS attackVelocity 2011 - Our first DDoS attack
Velocity 2011 - Our first DDoS attack
 
Tuning 17 march
Tuning 17 marchTuning 17 march
Tuning 17 march
 
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a MonthUSENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
 
VarnaConf - Blue/Green Deployments with Docker, haproxy and Consul
VarnaConf - Blue/Green Deployments with Docker, haproxy and ConsulVarnaConf - Blue/Green Deployments with Docker, haproxy and Consul
VarnaConf - Blue/Green Deployments with Docker, haproxy and Consul
 
Aniki - The ORM as our great brother.
Aniki - The ORM as our great brother.Aniki - The ORM as our great brother.
Aniki - The ORM as our great brother.
 
From pets to cattle - powered by CoreOS, docker, Mesos & nginx
From pets to cattle - powered by CoreOS, docker, Mesos & nginxFrom pets to cattle - powered by CoreOS, docker, Mesos & nginx
From pets to cattle - powered by CoreOS, docker, Mesos & nginx
 
Tuning TCP and NGINX on EC2
Tuning TCP and NGINX on EC2Tuning TCP and NGINX on EC2
Tuning TCP and NGINX on EC2
 
NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and Tuning
 
Keepalived & HA-Proxy as an alternative to commercial loadbalancer - August 2014
Keepalived & HA-Proxy as an alternative to commercial loadbalancer - August 2014Keepalived & HA-Proxy as an alternative to commercial loadbalancer - August 2014
Keepalived & HA-Proxy as an alternative to commercial loadbalancer - August 2014
 
DDoS Attacks
DDoS AttacksDDoS Attacks
DDoS Attacks
 
Implementing Rolling Upgrades using Mesos, Marathon, Docker, HAProxy
Implementing Rolling Upgrades using Mesos, Marathon, Docker, HAProxyImplementing Rolling Upgrades using Mesos, Marathon, Docker, HAProxy
Implementing Rolling Upgrades using Mesos, Marathon, Docker, HAProxy
 

Similar a HAProxy tech talk

Modern Application Stacks
Modern Application StacksModern Application Stacks
Modern Application Stackschartjes
 
Profiling php applications
Profiling php applicationsProfiling php applications
Profiling php applicationsJustin Carmony
 
Web technologies lesson 1
Web technologies   lesson 1Web technologies   lesson 1
Web technologies lesson 1nhepner
 
Memcached, presented to LCA2010
Memcached, presented to LCA2010Memcached, presented to LCA2010
Memcached, presented to LCA2010Mark Atwood
 
PHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the foolPHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the foolAlessandro Cinelli (cirpo)
 
23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboards23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboardsDenis Ristic
 
Server Monitoring (Scaling while bootstrapped)
Server Monitoring  (Scaling while bootstrapped)Server Monitoring  (Scaling while bootstrapped)
Server Monitoring (Scaling while bootstrapped)Ajibola Aiyedogbon
 
Integrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIntegrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIvo Jansch
 
Web Technology Management Lecture III
Web Technology Management Lecture IIIWeb Technology Management Lecture III
Web Technology Management Lecture IIIsopekmir
 
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010 Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010 Matt Gauger
 
De-Mystifying the Apache Phoenix QueryServer
De-Mystifying the Apache Phoenix QueryServerDe-Mystifying the Apache Phoenix QueryServer
De-Mystifying the Apache Phoenix QueryServerJosh Elser
 
WebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect Toolbox
WebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect ToolboxWebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect Toolbox
WebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect ToolboxWebCamp
 
Anvita Gita Supersite Case Study Nov2000
Anvita   Gita Supersite Case Study Nov2000Anvita   Gita Supersite Case Study Nov2000
Anvita Gita Supersite Case Study Nov2000guest6e7a1b1
 
ReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... YawnReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... Yawnozten
 
CDN and Cloud - PHPFest 2011
CDN and Cloud - PHPFest 2011CDN and Cloud - PHPFest 2011
CDN and Cloud - PHPFest 2011Junho Choi
 
PHP Performance: Principles and tools
PHP Performance: Principles and toolsPHP Performance: Principles and tools
PHP Performance: Principles and tools10n Software, LLC
 
qooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkqooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkecker
 
Apache Phoenix Query Server PhoenixCon2016
Apache Phoenix Query Server PhoenixCon2016Apache Phoenix Query Server PhoenixCon2016
Apache Phoenix Query Server PhoenixCon2016Josh Elser
 

Similar a HAProxy tech talk (20)

Modern Application Stacks
Modern Application StacksModern Application Stacks
Modern Application Stacks
 
Profiling php applications
Profiling php applicationsProfiling php applications
Profiling php applications
 
Web technologies lesson 1
Web technologies   lesson 1Web technologies   lesson 1
Web technologies lesson 1
 
Memcached, presented to LCA2010
Memcached, presented to LCA2010Memcached, presented to LCA2010
Memcached, presented to LCA2010
 
PHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the foolPHP is the King, nodejs is the Prince and Lua is the fool
PHP is the King, nodejs is the Prince and Lua is the fool
 
Webtechnologies
Webtechnologies Webtechnologies
Webtechnologies
 
23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboards23 LAMP Stack #burningkeyboards
23 LAMP Stack #burningkeyboards
 
Server Monitoring (Scaling while bootstrapped)
Server Monitoring  (Scaling while bootstrapped)Server Monitoring  (Scaling while bootstrapped)
Server Monitoring (Scaling while bootstrapped)
 
Integrating PHP With System-i using Web Services
Integrating PHP With System-i using Web ServicesIntegrating PHP With System-i using Web Services
Integrating PHP With System-i using Web Services
 
Web Technology Management Lecture III
Web Technology Management Lecture IIIWeb Technology Management Lecture III
Web Technology Management Lecture III
 
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010 Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
 
De-Mystifying the Apache Phoenix QueryServer
De-Mystifying the Apache Phoenix QueryServerDe-Mystifying the Apache Phoenix QueryServer
De-Mystifying the Apache Phoenix QueryServer
 
WebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect Toolbox
WebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect ToolboxWebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect Toolbox
WebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect Toolbox
 
Anvita Gita Supersite Case Study Nov2000
Anvita   Gita Supersite Case Study Nov2000Anvita   Gita Supersite Case Study Nov2000
Anvita Gita Supersite Case Study Nov2000
 
ReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... YawnReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... Yawn
 
CDN and Cloud - PHPFest 2011
CDN and Cloud - PHPFest 2011CDN and Cloud - PHPFest 2011
CDN and Cloud - PHPFest 2011
 
PHP Performance: Principles and tools
PHP Performance: Principles and toolsPHP Performance: Principles and tools
PHP Performance: Principles and tools
 
qooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkqooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Framework
 
Apache Phoenix Query Server PhoenixCon2016
Apache Phoenix Query Server PhoenixCon2016Apache Phoenix Query Server PhoenixCon2016
Apache Phoenix Query Server PhoenixCon2016
 
slides (PPT)
slides (PPT)slides (PPT)
slides (PPT)
 

Último

Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 

Último (20)

Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

HAProxy tech talk

  • 3.
  • 4. Simplified Web Architecture Web Clients Dynamic “Data” Server PHP Memcache iPhones Nginx PostgreSQL Ruby MySQL Androids Apache Perl Mongo CouchDB Python Redis Browsers lighttpd Node.js Oracle
  • 5. ChOP Archtiecture Web Clients Dynamic “Data” Server Memcache iPhone MySQL Android Nginx PHP5-FPM Redis Desktop Chat
  • 6. YouVersion Architecture Web Clients Dynamic “Data” Server Memcache iPhone PHP5-FPM PostgreSQL Android Nginx Mongo Ruby (coming Desktop soon) Oracle
  • 7. HAProxy ¡  High Availability Proxy ¡  TCP load balancing proxy with awesome health checking built in ¡  Fast ¡  Scalable ¡  Makes non-HA services HA
  • 8. How I Love Thee, Let Me Count The Ways… ¡  Rock solid ¡  Dead simple to run and configure ¡  Comprehensive Health Checking ¡  Lots of statistics
  • 9.
  • 10. HAProxy Uses ¡  Not really a service unto itself ¡  Fits into the gaps between layers well ¡  Issue: Becomes a single point of failure itself HAProxy HAProxy* HAProxy* Web Dynamic Clients “Data” Server Engine * – potential future use
  • 11. Eliminating SPOFs ¡  Two types of HAProxy SPOFs: ¡  Service Outage (Hardware failure or HAProxy service failure) ¡  HAProxy Limit Outage / Upstream Outage (Hit some arbitrary limit we defined somewhere or ran out of some slots somewhere)
  • 12. Service Outage ¡  HAProxy service crashes or dies for some reason (has never happened, knock on wood) ¡  Hardware / Network Failure
  • 13. Service Outage: Solution ¡  Corosync & Pacemaker ¡  Hard to configure at first, but don’t really need to touch it later ¡  Pretty much magic ¡  Two Corosync HAProxy clusters: DFW and SAN ¡  Setup is blogged about here: http://itand.me/41901523
  • 14. HAProxy Limit Outage / Upstream Outage ¡  Usually because of an outage further upstream at the Dynamic or “Data” layer ¡  Completely Hypothetical Situation: Mongo slows down, causing PHP processes to back up, causing the connection limit to go through the roof, causing total outage
  • 15. What it looks like on the graph (Yesterday) OR: WHY WE MUST MOVE MONGO STAT!
  • 16. For ChOP (Chat), it’s a little different…
  • 17. Upstream Outage ¡  Usually the result of running out of PHP processes. ¡  Normally each PHP process can process hundreds of req/s ¡  Something slows them down (mongo, postgres, et al) so a process can only process a smaller number of req / s (or, worse, seconds / req) ¡  Inevitably, these requests take all PHP processes, nothing else can run and HAProxy fails all health checks and shows you Binary Jesus
  • 18. “Solutions” ¡  Start Hashing URLs to avoid upstream failures ¡  Want to send all URL requests to the same app server so if it’s slow only that app server goes down ¡  Some benefit to caching as well ¡  Challenge: want to hash only part of a URL ¡  Challenge: need to separate app servers into “availability groups” ¡  Challenge: deployments, monitoring, alerting, all that crap…
  • 19. HAProxy Limit Outage ¡  We set limits on all HAProxy backends and front ends and servers to ensure they don’t get overwhelmed ¡  Sometimes these limits are too low ¡  Solution: Raise them ¡  Challenge: Raise them too high without regard for the backend, and you could cause more harm than good (Stampeding Herd)
  • 20. Q&A