SlideShare a Scribd company logo
Confidential
Load Balancing with HAProxy and MySQL
January 28, 2015
Alex Yu

alex@severalnines.com
Copyright Severalnines AB
Webinar Housekeeping
!This webinar is being recorded
!A link to the recording & slides will be posted on severalnines.com
!We welcome questions: enter questions into the chat box and we
will respond at the end of the presentation
!Think of something later?
! Email Severalnines at info@severalnines.com
2
Copyright Severalnines AB
Agenda
!What Is HAProxy?
!SQL Load Balancing with HAProxy
! Failure detection with MySQL
!Fault Tolerance with HAProxy
! Active/Passive setup
!Deployment Scenarios
! MySQL Cluster, Galera Cluster and MySQL Replication
!Load Balancing Alternatives
3
Copyright Severalnines AB
Why Load Balance?
!Optimising server utilisation
! Queuing and throttling
!Maximise availability
! No SPOF
!Maximise throughput
! Distribute workload across a set of servers
!Scalability
! Site traffic grows
! Add DB servers to provide more throughput
4
LB
DB DB DB …
!Reliable High Performance TCP/HTTP Load Balancer
! v1.5 stable released June 2014
! Native SSL support, IPv6, full HTTP keepalive, HTTP Compression …
! v1.4 most deployed and stable version, released Feb 2010
! client-side keep alive, TCP speedups, source base stickiness …
! Single Process Event-Driven. Can easily saturate 10Gb link with a single instance
! 108 000 session/s, http://www.haproxy.org/10g.html (2009)
!Reverse Proxy
! load balancing, scaling out, failover (health checks)
!High traffic sites like
! reddit, DISQUS, GitHub, Imgur, StackOverflow/Server Fault, Instagram …
Copyright Severalnines AB
HAProxy?
5
Copyright Severalnines AB
SQL Load Balancing for MySQL
!Configuration file
! Sections; global, defaults, frontend, backend, listen
! /etc/haproxy/haproxy.cfg
!Global (process wide)
6
MySQL
[WSREP]
Galera Replication (Synchronous)
LB
MySQL
[WSREP]
MySQL
[WSREP]
R/W R/W R/W
Client Client Client
global

log 127.0.0.1 local0
pidfile /var/run/haproxy.pid
daemon
user nobody
group nobody
stats socket /tmp/haproxy.socket …
node HAProxy_1
description HAProxy 1
maxconn 40000
spread-checks 3
quiet
Copyright Severalnines AB
SQL Load Balancing for MySQL (cont.)
!defaults
7
MySQL
[WSREP]
Galera Replication (Synchronous)
LB
MySQL
[WSREP]
MySQL
[WSREP]
R/W R/W R/W
Client Client Client
defaults
log global
mode tcp
maxconn 40000
option dontlognull
option tcp-smart-accept
option tcp-smart-connect
option redispatch
retries 3
timeout queue 3500ms
timeout connect 3500ms
timeout client 120s
timeout server 120s
Copyright Severalnines AB
SQL Load Balancing for MySQL (cont.)
!listen (frontend + backend)
8
listen s9s1_33306_defaul_LB
mode tcp

bind *:33306
timeout client 60s
timeout server 60s
balance leastconn
option httpchk
default-server port 9200 inter 2s downinter 5s rise 3 fall 2 slowstart 60s maxconn 256
maxqueue 128 weight 100
server db1 10.0.3.70:3306 check
server db2 10.0.3.60:3306 check
server db3 10.0.3.50:3306 check
Copyright Severalnines AB
SQL Load Balancing for MySQL (cont.)
!listen (stats ui)
9
userlist STATSUSERS
group admin users admin
user admin insecure-password admin
listen admin_page 0.0.0.0:9600
mode http
stats enable
stats refresh 60s
stats uri /
acl AuthOkay_ReadOnly http_auth(STATSUSERS)
acl AuthOkay_Admin http_auth_group(STATSUSERS) admin
stats http-request auth realm admin_page unless AuthOkay_ReadOnly
Copyright Severalnines AB
10
!Session rate
! number of new connections per second
!Sessions
! current number of sessions/connections
!LastChk
! health check
!Wght
! server weight
Copyright Severalnines AB
MySQL Health Checks
11
!Built-in MySQL health check
! option mysql-check user <username>
! Sends two MySQL packages
! Authentication and Quit
! No errors unless MySQL server is down
!Complete HTTP Request
! option httpchk
! Response: HTTP/1.1 200 OK
! Check Host and/or MySQL server state
! Galera Node State
MySQL
[WSREP]
Galera Replication (Synchronous)
LB
MySQL
[WSREP]
MySQL
[WSREP]
R/W R/W R/W
Client Client Client
Copyright Severalnines AB
MySQL Health Checks (cont.)
12
!Galera Node
! Check 1: Get node state
! SYNCED or DONOR
! Check 2: If Node is a “DONOR”
! Get the SST method
! xtrabackup
! Return “200 OK”
! rsync or mysqldump
! Return “503 Service Unavailable” Galera Node State
Copyright Severalnines AB
MySQL Health Checks (cont.)
13
!xinetd service
! mysqlchk.sh (shell script)
! spams syslog by default
! log_on_success =
#/etc/xinetd.d/mysqlchk
# default: on
# description: mysqlchk
service mysqlchk
{
flags = REUSE
socket_type = stream
port = 9200
wait = no
user = nobody
server = /usr/local/bin/mysqlchk.sh
log_on_failure += USERID
disable = no
#only_from = 0.0.0.0/0
per_source = UNLIMITED
}
Copyright Severalnines AB
Network Tuning
!TCP tuning
14
#/etc/sysctl.conf
net.ipv4.ip_nonlocal_bind=1
net.ipv4.tcp_tw_reuse=1 # reuse TIME-WAIT sockets
net.ipv4.ip_local_port_range=1024 65023 # increase max num of ports
net.ipv4.tcp_max_syn_backlog=40000 #Increase the number of outstanding syn requests
net.ipv4.tcp_max_tw_buckets=400000 # Maximal number of timewait sockets
net.ipv4.tcp_max_orphans=60000
net.ipv4.tcp_max_syn_backlog=40000 # TCP SYN Flood Protection
net.ipv4.tcp_synack_retries=3 # TCP SYN Flood Protection
net.core.somaxconn=40000 # burst connection rate
net.ipv4.tcp_fin_timeout=5 # how long to keep sockets in FIN-WAIT-2
Copyright Severalnines AB
Fault Tolerance for HAProxy
15
Client
HAProxy 1
MySQL
 MySQL
 MySQL

IP: 10.10.10.20
Copyright Severalnines AB
Fault Tolerance for HAProxy (cont.)
!Active/Passive IP failover
! keepalived
! VRRP protocol provides router/IP failover
!VIP, “floating IP”: 10.10.0.10
! net.ipv4.ip_nonlocal_bind=1
!Master - HAProxy 1
! IP: 10.10.10.20
!Backup - HAProxy 2
! IP: 10.10.10.30
16
Copyright Severalnines AB
Fault Tolerance for HAProxy (cont.)
!keepalived configuration file
17
#/etc/keepalived/keepalived.conf
vrrp_script chk_haproxy {
script "killall -0 haproxy" # verify the pid existence
interval 2 # check every 2 seconds
weight 2 # adjust priority by this weight
}
vrrp_instance VI_1 {
interface eth0
state MASTER
virtual_router_id 51 # ID for this route
priority 101 # 101 on master

# 100 on backup
virtual_ipaddress {
10.10.0.10 # the virtual IP
}
track_script {
chk_haproxy
}
}
Copyright Severalnines AB
ClusterControl HAProxy + Keepalived (cont.)
!Deployment and configuration automated from ClusterControl
18
Copyright Severalnines AB
ClusterControl HAProxy + Keepalived (cont.)
19
Copyright Severalnines AB
Deployment Scenarios
20
!MySQL Cluster / NDB Engine
! Active/Active, Shared nothing architecture
! SQL, Data and MGMT Nodes
! HAProxy co-located with MGMT Nodes
! MGMT is a light weight process
! Re-use “idle” servers
! Connections originate from HAProxy server
! Additional latency
! App Server <-> HAProxy <-> SQL Node <-> Data Node
NDB Data
Node
NDB Data
Node
(MGMT)
HAProxy
(MGMT)
HAProxy
SQL Node

MySQL
Server
SQL Node

MySQL
Server
Copyright Severalnines AB
Deployment Scenarios (cont.)
21
NDB Data
Node
NDB Data
Node
!MySQL Cluster / NDB Engine
! Active/Active, Shared nothing architecture
! SQL, Data and MGMT Nodes
! HAProxy co-located with App servers
! No extra latency
! Extra load on app servers
! Health check loads on SQL nodes from all LBs
! Alt: MySQL Connector/J’s JDBC driver
! jdbc:mysql:loadbalance://host-1,host-2,…host-n/database?
loadBalanceBlacklistTimeout=5000
! Config changes propagate to all app servers
(App)
HAProxy
(App)
HAProxy
SQL Node

MySQL
Server
SQL Node

MySQL
Server
Copyright Severalnines AB
Deployment Scenarios (cont.)
22
MySQL Slave
MySQL
Master
!MySQL Replication Master/Slave
! 1 Master for Writes
! N Slaves for Reads
! Separate front and backends configs for Master and Slaves
!ex: backend configuration for Slaves
HAProxy
MySQL Slave
MySQL Slave
Writes
Reads
frontend front_reads
mode tcp
bind 192.168.100.110:3316
default_backend cluster_reads


backend cluster_reads
mode tcp
balance roundrobin
server Slave1 10.10.10.30:3306 check
server Slave2 10.10.10.40:3306 check
Copyright Severalnines AB
Deployment Scenarios (cont.)
23
!Galera Cluster
! Synchronous Replication, Read & Write to any Node
! Cluster wide optimistic locking
! Higher probability for “deadlocks”
! Pessimistic locking on the Node
! Ex: sequence table, “hotspot” tables
! Write to one node, Read/Write split
! Application: Retry deadlock errors
MySQL
[WSREP]
Galera Replication (Synchronous)
LB
MySQL
[WSREP]
MySQL
[WSREP]
R/W R/W R/W
Client Client Client
Copyright Severalnines AB
Alternatives
!MySQL’s Connector/J JDBC driver
!jdbc:mysql:loadbalance://host-1,host-2,…
!PHP mysqlnd
! http://www.php.net/manual/en/intro.mysqlnd-ms.php
!Oracle’s MySQL Proxy 0.84
! http://dev.mysql.com/downloads/mysql-proxy/
!SkySQL’s MaxScale 1.0.0. beta
! https://github.com/skysql/MaxScale
!ProxySQL
! https://github.com/renecannao/proxysql
!Pen 0.24.0
! http://morestuff.siag.nu/category/pen/
24
Copyright Severalnines AB
Thank You!
!Tutorial – MySQL Load Balancing with HAProxy
! http://www.severalnines.com/resources/clustercontrol-mysql-haproxy-load-
balancing-tutorial
!Severalnines Blog and Webinars
! www.severalnines.com/blog
! http://www.severalnines.com/resources/webinars
!More Questions? Contact us at:
! info@severalnines.com
25

More Related Content

What's hot

Galera cluster for MySQL - Introduction Slides
Galera cluster for MySQL - Introduction SlidesGalera cluster for MySQL - Introduction Slides
Galera cluster for MySQL - Introduction Slides
Severalnines
 
Apache HBase Performance Tuning
Apache HBase Performance TuningApache HBase Performance Tuning
Apache HBase Performance Tuning
Lars Hofhansl
 
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Severalnines
 
Sharding Methods for MongoDB
Sharding Methods for MongoDBSharding Methods for MongoDB
Sharding Methods for MongoDB
MongoDB
 
The consequences of sync_binlog != 1
The consequences of sync_binlog != 1The consequences of sync_binlog != 1
The consequences of sync_binlog != 1
Jean-François Gagné
 
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RACThe Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
Markus Michalewicz
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
NeoClova
 
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
Severalnines
 
State of the Dolphin - May 2022
State of the Dolphin - May 2022State of the Dolphin - May 2022
State of the Dolphin - May 2022
Frederic Descamps
 
Using Wildcards with rsyslog's File Monitor imfile
Using Wildcards with rsyslog's File Monitor imfileUsing Wildcards with rsyslog's File Monitor imfile
Using Wildcards with rsyslog's File Monitor imfile
Rainer Gerhards
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
Altinity Ltd
 
Introduction to Storm
Introduction to Storm Introduction to Storm
Introduction to Storm Chandler Huang
 
Automated master failover
Automated master failoverAutomated master failover
Automated master failover
Yoshinori Matsunobu
 
ProxySQL at Scale on AWS.pdf
ProxySQL at Scale on AWS.pdfProxySQL at Scale on AWS.pdf
ProxySQL at Scale on AWS.pdf
Aleksandr Kuzminsky
 
Top 5 Mistakes to Avoid When Writing Apache Spark Applications
Top 5 Mistakes to Avoid When Writing Apache Spark ApplicationsTop 5 Mistakes to Avoid When Writing Apache Spark Applications
Top 5 Mistakes to Avoid When Writing Apache Spark Applications
Cloudera, Inc.
 
MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!
Vitor Oliveira
 
Introduction to Galera Cluster
Introduction to Galera ClusterIntroduction to Galera Cluster
Introduction to Galera Cluster
Codership Oy - Creators of Galera Cluster
 
MySQL Database Architectures - High Availability and Disaster Recovery Solution
MySQL Database Architectures - High Availability and Disaster Recovery SolutionMySQL Database Architectures - High Availability and Disaster Recovery Solution
MySQL Database Architectures - High Availability and Disaster Recovery Solution
Miguel Araújo
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
mumrah
 
Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014
Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014
Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014
Julien Le Dem
 

What's hot (20)

Galera cluster for MySQL - Introduction Slides
Galera cluster for MySQL - Introduction SlidesGalera cluster for MySQL - Introduction Slides
Galera cluster for MySQL - Introduction Slides
 
Apache HBase Performance Tuning
Apache HBase Performance TuningApache HBase Performance Tuning
Apache HBase Performance Tuning
 
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
 
Sharding Methods for MongoDB
Sharding Methods for MongoDBSharding Methods for MongoDB
Sharding Methods for MongoDB
 
The consequences of sync_binlog != 1
The consequences of sync_binlog != 1The consequences of sync_binlog != 1
The consequences of sync_binlog != 1
 
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RACThe Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
 
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
 
State of the Dolphin - May 2022
State of the Dolphin - May 2022State of the Dolphin - May 2022
State of the Dolphin - May 2022
 
Using Wildcards with rsyslog's File Monitor imfile
Using Wildcards with rsyslog's File Monitor imfileUsing Wildcards with rsyslog's File Monitor imfile
Using Wildcards with rsyslog's File Monitor imfile
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
 
Introduction to Storm
Introduction to Storm Introduction to Storm
Introduction to Storm
 
Automated master failover
Automated master failoverAutomated master failover
Automated master failover
 
ProxySQL at Scale on AWS.pdf
ProxySQL at Scale on AWS.pdfProxySQL at Scale on AWS.pdf
ProxySQL at Scale on AWS.pdf
 
Top 5 Mistakes to Avoid When Writing Apache Spark Applications
Top 5 Mistakes to Avoid When Writing Apache Spark ApplicationsTop 5 Mistakes to Avoid When Writing Apache Spark Applications
Top 5 Mistakes to Avoid When Writing Apache Spark Applications
 
MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!
 
Introduction to Galera Cluster
Introduction to Galera ClusterIntroduction to Galera Cluster
Introduction to Galera Cluster
 
MySQL Database Architectures - High Availability and Disaster Recovery Solution
MySQL Database Architectures - High Availability and Disaster Recovery SolutionMySQL Database Architectures - High Availability and Disaster Recovery Solution
MySQL Database Architectures - High Availability and Disaster Recovery Solution
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
 
Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014
Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014
Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014
 

Similar to Load Balancing MySQL with HAProxy - Slides

Squeak DBX
Squeak DBXSqueak DBX
Squeak DBX
ESUG
 
Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...
Fwdays
 
Optimizing Apache HBase for Cloud Storage in Microsoft Azure HDInsight
Optimizing Apache HBase for Cloud Storage in Microsoft Azure HDInsightOptimizing Apache HBase for Cloud Storage in Microsoft Azure HDInsight
Optimizing Apache HBase for Cloud Storage in Microsoft Azure HDInsight
HBaseCon
 
Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?
Ludovico Caldara
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18
Derek Downey
 
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
 
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQLHTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
Ulf Wendel
 
AWS APAC Webinar Week - AWS MySQL Relational Database Services Best Practices...
AWS APAC Webinar Week - AWS MySQL Relational Database Services Best Practices...AWS APAC Webinar Week - AWS MySQL Relational Database Services Best Practices...
AWS APAC Webinar Week - AWS MySQL Relational Database Services Best Practices...
Amazon Web Services
 
DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...
DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...
DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...
Timofey Turenko
 
MySQL Replication Update -- Zendcon 2016
MySQL Replication Update -- Zendcon 2016MySQL Replication Update -- Zendcon 2016
MySQL Replication Update -- Zendcon 2016
Dave Stokes
 
Deploying your web application with AWS ElasticBeanstalk
Deploying your web application with AWS ElasticBeanstalkDeploying your web application with AWS ElasticBeanstalk
Deploying your web application with AWS ElasticBeanstalk
Julien SIMON
 
9 DevOps Tips for Going in Production with Galera Cluster for MySQL - Slides
9 DevOps Tips for Going in Production with Galera Cluster for MySQL - Slides9 DevOps Tips for Going in Production with Galera Cluster for MySQL - Slides
9 DevOps Tips for Going in Production with Galera Cluster for MySQL - Slides
Severalnines
 
MySQL Replication
MySQL ReplicationMySQL Replication
MySQL Replication
Mark Swarbrick
 
Four Ways to Improve ASP .NET Performance and Scalability
 Four Ways to Improve ASP .NET Performance and Scalability Four Ways to Improve ASP .NET Performance and Scalability
Four Ways to Improve ASP .NET Performance and Scalability
Alachisoft
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
Fabio Akita
 
MySQL Replication Overview -- PHPTek 2016
MySQL Replication Overview -- PHPTek 2016MySQL Replication Overview -- PHPTek 2016
MySQL Replication Overview -- PHPTek 2016
Dave Stokes
 
Built in physical and logical replication in postgresql-Firat Gulec
Built in physical and logical replication in postgresql-Firat GulecBuilt in physical and logical replication in postgresql-Firat Gulec
Built in physical and logical replication in postgresql-Firat Gulec
FIRAT GULEC
 
12 Things about Oracle WebLogic Server 12c
12 Things	 about Oracle WebLogic Server 12c12 Things	 about Oracle WebLogic Server 12c
12 Things about Oracle WebLogic Server 12c
Guatemala User Group
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)
Flowdock
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & ScalabilityJoseph Scott
 

Similar to Load Balancing MySQL with HAProxy - Slides (20)

Squeak DBX
Squeak DBXSqueak DBX
Squeak DBX
 
Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...
 
Optimizing Apache HBase for Cloud Storage in Microsoft Azure HDInsight
Optimizing Apache HBase for Cloud Storage in Microsoft Azure HDInsightOptimizing Apache HBase for Cloud Storage in Microsoft Azure HDInsight
Optimizing Apache HBase for Cloud Storage in Microsoft Azure HDInsight
 
Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18
 
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...
 
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQLHTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
 
AWS APAC Webinar Week - AWS MySQL Relational Database Services Best Practices...
AWS APAC Webinar Week - AWS MySQL Relational Database Services Best Practices...AWS APAC Webinar Week - AWS MySQL Relational Database Services Best Practices...
AWS APAC Webinar Week - AWS MySQL Relational Database Services Best Practices...
 
DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...
DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...
DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...
 
MySQL Replication Update -- Zendcon 2016
MySQL Replication Update -- Zendcon 2016MySQL Replication Update -- Zendcon 2016
MySQL Replication Update -- Zendcon 2016
 
Deploying your web application with AWS ElasticBeanstalk
Deploying your web application with AWS ElasticBeanstalkDeploying your web application with AWS ElasticBeanstalk
Deploying your web application with AWS ElasticBeanstalk
 
9 DevOps Tips for Going in Production with Galera Cluster for MySQL - Slides
9 DevOps Tips for Going in Production with Galera Cluster for MySQL - Slides9 DevOps Tips for Going in Production with Galera Cluster for MySQL - Slides
9 DevOps Tips for Going in Production with Galera Cluster for MySQL - Slides
 
MySQL Replication
MySQL ReplicationMySQL Replication
MySQL Replication
 
Four Ways to Improve ASP .NET Performance and Scalability
 Four Ways to Improve ASP .NET Performance and Scalability Four Ways to Improve ASP .NET Performance and Scalability
Four Ways to Improve ASP .NET Performance and Scalability
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
MySQL Replication Overview -- PHPTek 2016
MySQL Replication Overview -- PHPTek 2016MySQL Replication Overview -- PHPTek 2016
MySQL Replication Overview -- PHPTek 2016
 
Built in physical and logical replication in postgresql-Firat Gulec
Built in physical and logical replication in postgresql-Firat GulecBuilt in physical and logical replication in postgresql-Firat Gulec
Built in physical and logical replication in postgresql-Firat Gulec
 
12 Things about Oracle WebLogic Server 12c
12 Things	 about Oracle WebLogic Server 12c12 Things	 about Oracle WebLogic Server 12c
12 Things about Oracle WebLogic Server 12c
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & Scalability
 

More from Severalnines

DIY DBaaS: A guide to building your own full-featured DBaaS
DIY DBaaS: A guide to building your own full-featured DBaaSDIY DBaaS: A guide to building your own full-featured DBaaS
DIY DBaaS: A guide to building your own full-featured DBaaS
Severalnines
 
Cloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaSCloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaS
Severalnines
 
Tips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloudTips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloud
Severalnines
 
Working with the Moodle Database: The Basics
Working with the Moodle Database: The BasicsWorking with the Moodle Database: The Basics
Working with the Moodle Database: The Basics
Severalnines
 
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
Severalnines
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
Severalnines
 
Webinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBWebinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDB
Severalnines
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Severalnines
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Severalnines
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Severalnines
 
Disaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBDisaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDB
Severalnines
 
MariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseMariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash Course
Severalnines
 
Performance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBPerformance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDB
Severalnines
 
Advanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerAdvanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona Server
Severalnines
 
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifePolyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Severalnines
 
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Severalnines
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Severalnines
 
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningWebinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Severalnines
 
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBWebinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Severalnines
 
Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?
Severalnines
 

More from Severalnines (20)

DIY DBaaS: A guide to building your own full-featured DBaaS
DIY DBaaS: A guide to building your own full-featured DBaaSDIY DBaaS: A guide to building your own full-featured DBaaS
DIY DBaaS: A guide to building your own full-featured DBaaS
 
Cloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaSCloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaS
 
Tips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloudTips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloud
 
Working with the Moodle Database: The Basics
Working with the Moodle Database: The BasicsWorking with the Moodle Database: The Basics
Working with the Moodle Database: The Basics
 
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
 
Webinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBWebinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDB
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
 
Disaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBDisaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDB
 
MariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseMariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash Course
 
Performance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBPerformance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDB
 
Advanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerAdvanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona Server
 
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifePolyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
 
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
 
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningWebinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
 
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBWebinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
 
Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 

Load Balancing MySQL with HAProxy - Slides

  • 1. Confidential Load Balancing with HAProxy and MySQL January 28, 2015 Alex Yu
 alex@severalnines.com
  • 2. Copyright Severalnines AB Webinar Housekeeping !This webinar is being recorded !A link to the recording & slides will be posted on severalnines.com !We welcome questions: enter questions into the chat box and we will respond at the end of the presentation !Think of something later? ! Email Severalnines at info@severalnines.com 2
  • 3. Copyright Severalnines AB Agenda !What Is HAProxy? !SQL Load Balancing with HAProxy ! Failure detection with MySQL !Fault Tolerance with HAProxy ! Active/Passive setup !Deployment Scenarios ! MySQL Cluster, Galera Cluster and MySQL Replication !Load Balancing Alternatives 3
  • 4. Copyright Severalnines AB Why Load Balance? !Optimising server utilisation ! Queuing and throttling !Maximise availability ! No SPOF !Maximise throughput ! Distribute workload across a set of servers !Scalability ! Site traffic grows ! Add DB servers to provide more throughput 4 LB DB DB DB …
  • 5. !Reliable High Performance TCP/HTTP Load Balancer ! v1.5 stable released June 2014 ! Native SSL support, IPv6, full HTTP keepalive, HTTP Compression … ! v1.4 most deployed and stable version, released Feb 2010 ! client-side keep alive, TCP speedups, source base stickiness … ! Single Process Event-Driven. Can easily saturate 10Gb link with a single instance ! 108 000 session/s, http://www.haproxy.org/10g.html (2009) !Reverse Proxy ! load balancing, scaling out, failover (health checks) !High traffic sites like ! reddit, DISQUS, GitHub, Imgur, StackOverflow/Server Fault, Instagram … Copyright Severalnines AB HAProxy? 5
  • 6. Copyright Severalnines AB SQL Load Balancing for MySQL !Configuration file ! Sections; global, defaults, frontend, backend, listen ! /etc/haproxy/haproxy.cfg !Global (process wide) 6 MySQL [WSREP] Galera Replication (Synchronous) LB MySQL [WSREP] MySQL [WSREP] R/W R/W R/W Client Client Client global
 log 127.0.0.1 local0 pidfile /var/run/haproxy.pid daemon user nobody group nobody stats socket /tmp/haproxy.socket … node HAProxy_1 description HAProxy 1 maxconn 40000 spread-checks 3 quiet
  • 7. Copyright Severalnines AB SQL Load Balancing for MySQL (cont.) !defaults 7 MySQL [WSREP] Galera Replication (Synchronous) LB MySQL [WSREP] MySQL [WSREP] R/W R/W R/W Client Client Client defaults log global mode tcp maxconn 40000 option dontlognull option tcp-smart-accept option tcp-smart-connect option redispatch retries 3 timeout queue 3500ms timeout connect 3500ms timeout client 120s timeout server 120s
  • 8. Copyright Severalnines AB SQL Load Balancing for MySQL (cont.) !listen (frontend + backend) 8 listen s9s1_33306_defaul_LB mode tcp
 bind *:33306 timeout client 60s timeout server 60s balance leastconn option httpchk default-server port 9200 inter 2s downinter 5s rise 3 fall 2 slowstart 60s maxconn 256 maxqueue 128 weight 100 server db1 10.0.3.70:3306 check server db2 10.0.3.60:3306 check server db3 10.0.3.50:3306 check
  • 9. Copyright Severalnines AB SQL Load Balancing for MySQL (cont.) !listen (stats ui) 9 userlist STATSUSERS group admin users admin user admin insecure-password admin listen admin_page 0.0.0.0:9600 mode http stats enable stats refresh 60s stats uri / acl AuthOkay_ReadOnly http_auth(STATSUSERS) acl AuthOkay_Admin http_auth_group(STATSUSERS) admin stats http-request auth realm admin_page unless AuthOkay_ReadOnly
  • 10. Copyright Severalnines AB 10 !Session rate ! number of new connections per second !Sessions ! current number of sessions/connections !LastChk ! health check !Wght ! server weight
  • 11. Copyright Severalnines AB MySQL Health Checks 11 !Built-in MySQL health check ! option mysql-check user <username> ! Sends two MySQL packages ! Authentication and Quit ! No errors unless MySQL server is down !Complete HTTP Request ! option httpchk ! Response: HTTP/1.1 200 OK ! Check Host and/or MySQL server state ! Galera Node State MySQL [WSREP] Galera Replication (Synchronous) LB MySQL [WSREP] MySQL [WSREP] R/W R/W R/W Client Client Client
  • 12. Copyright Severalnines AB MySQL Health Checks (cont.) 12 !Galera Node ! Check 1: Get node state ! SYNCED or DONOR ! Check 2: If Node is a “DONOR” ! Get the SST method ! xtrabackup ! Return “200 OK” ! rsync or mysqldump ! Return “503 Service Unavailable” Galera Node State
  • 13. Copyright Severalnines AB MySQL Health Checks (cont.) 13 !xinetd service ! mysqlchk.sh (shell script) ! spams syslog by default ! log_on_success = #/etc/xinetd.d/mysqlchk # default: on # description: mysqlchk service mysqlchk { flags = REUSE socket_type = stream port = 9200 wait = no user = nobody server = /usr/local/bin/mysqlchk.sh log_on_failure += USERID disable = no #only_from = 0.0.0.0/0 per_source = UNLIMITED }
  • 14. Copyright Severalnines AB Network Tuning !TCP tuning 14 #/etc/sysctl.conf net.ipv4.ip_nonlocal_bind=1 net.ipv4.tcp_tw_reuse=1 # reuse TIME-WAIT sockets net.ipv4.ip_local_port_range=1024 65023 # increase max num of ports net.ipv4.tcp_max_syn_backlog=40000 #Increase the number of outstanding syn requests net.ipv4.tcp_max_tw_buckets=400000 # Maximal number of timewait sockets net.ipv4.tcp_max_orphans=60000 net.ipv4.tcp_max_syn_backlog=40000 # TCP SYN Flood Protection net.ipv4.tcp_synack_retries=3 # TCP SYN Flood Protection net.core.somaxconn=40000 # burst connection rate net.ipv4.tcp_fin_timeout=5 # how long to keep sockets in FIN-WAIT-2
  • 15. Copyright Severalnines AB Fault Tolerance for HAProxy 15 Client HAProxy 1 MySQL
 MySQL
 MySQL
 IP: 10.10.10.20
  • 16. Copyright Severalnines AB Fault Tolerance for HAProxy (cont.) !Active/Passive IP failover ! keepalived ! VRRP protocol provides router/IP failover !VIP, “floating IP”: 10.10.0.10 ! net.ipv4.ip_nonlocal_bind=1 !Master - HAProxy 1 ! IP: 10.10.10.20 !Backup - HAProxy 2 ! IP: 10.10.10.30 16
  • 17. Copyright Severalnines AB Fault Tolerance for HAProxy (cont.) !keepalived configuration file 17 #/etc/keepalived/keepalived.conf vrrp_script chk_haproxy { script "killall -0 haproxy" # verify the pid existence interval 2 # check every 2 seconds weight 2 # adjust priority by this weight } vrrp_instance VI_1 { interface eth0 state MASTER virtual_router_id 51 # ID for this route priority 101 # 101 on master
 # 100 on backup virtual_ipaddress { 10.10.0.10 # the virtual IP } track_script { chk_haproxy } }
  • 18. Copyright Severalnines AB ClusterControl HAProxy + Keepalived (cont.) !Deployment and configuration automated from ClusterControl 18
  • 19. Copyright Severalnines AB ClusterControl HAProxy + Keepalived (cont.) 19
  • 20. Copyright Severalnines AB Deployment Scenarios 20 !MySQL Cluster / NDB Engine ! Active/Active, Shared nothing architecture ! SQL, Data and MGMT Nodes ! HAProxy co-located with MGMT Nodes ! MGMT is a light weight process ! Re-use “idle” servers ! Connections originate from HAProxy server ! Additional latency ! App Server <-> HAProxy <-> SQL Node <-> Data Node NDB Data Node NDB Data Node (MGMT) HAProxy (MGMT) HAProxy SQL Node
 MySQL Server SQL Node
 MySQL Server
  • 21. Copyright Severalnines AB Deployment Scenarios (cont.) 21 NDB Data Node NDB Data Node !MySQL Cluster / NDB Engine ! Active/Active, Shared nothing architecture ! SQL, Data and MGMT Nodes ! HAProxy co-located with App servers ! No extra latency ! Extra load on app servers ! Health check loads on SQL nodes from all LBs ! Alt: MySQL Connector/J’s JDBC driver ! jdbc:mysql:loadbalance://host-1,host-2,…host-n/database? loadBalanceBlacklistTimeout=5000 ! Config changes propagate to all app servers (App) HAProxy (App) HAProxy SQL Node
 MySQL Server SQL Node
 MySQL Server
  • 22. Copyright Severalnines AB Deployment Scenarios (cont.) 22 MySQL Slave MySQL Master !MySQL Replication Master/Slave ! 1 Master for Writes ! N Slaves for Reads ! Separate front and backends configs for Master and Slaves !ex: backend configuration for Slaves HAProxy MySQL Slave MySQL Slave Writes Reads frontend front_reads mode tcp bind 192.168.100.110:3316 default_backend cluster_reads 
 backend cluster_reads mode tcp balance roundrobin server Slave1 10.10.10.30:3306 check server Slave2 10.10.10.40:3306 check
  • 23. Copyright Severalnines AB Deployment Scenarios (cont.) 23 !Galera Cluster ! Synchronous Replication, Read & Write to any Node ! Cluster wide optimistic locking ! Higher probability for “deadlocks” ! Pessimistic locking on the Node ! Ex: sequence table, “hotspot” tables ! Write to one node, Read/Write split ! Application: Retry deadlock errors MySQL [WSREP] Galera Replication (Synchronous) LB MySQL [WSREP] MySQL [WSREP] R/W R/W R/W Client Client Client
  • 24. Copyright Severalnines AB Alternatives !MySQL’s Connector/J JDBC driver !jdbc:mysql:loadbalance://host-1,host-2,… !PHP mysqlnd ! http://www.php.net/manual/en/intro.mysqlnd-ms.php !Oracle’s MySQL Proxy 0.84 ! http://dev.mysql.com/downloads/mysql-proxy/ !SkySQL’s MaxScale 1.0.0. beta ! https://github.com/skysql/MaxScale !ProxySQL ! https://github.com/renecannao/proxysql !Pen 0.24.0 ! http://morestuff.siag.nu/category/pen/ 24
  • 25. Copyright Severalnines AB Thank You! !Tutorial – MySQL Load Balancing with HAProxy ! http://www.severalnines.com/resources/clustercontrol-mysql-haproxy-load- balancing-tutorial !Severalnines Blog and Webinars ! www.severalnines.com/blog ! http://www.severalnines.com/resources/webinars !More Questions? Contact us at: ! info@severalnines.com 25