SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à Optimize HAProxy for high availability and scalability

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
 

Similaire à Optimize HAProxy for high availability and scalability (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)
 

Dernier

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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
🐬 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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Dernier (20)

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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Optimize HAProxy for high availability and scalability

  • 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