SlideShare a Scribd company logo
Copyright 2017 Severalnines AB
1
Your host & some logistics
I'm Jean-Jérôme from the Severalnines Team
and I'm your host for today's webinar!
Feel free to ask any questions in the Questions
section of this application or via the Chat box.
You can also contact me directly via the chat
box or via email: jj@severalnines.com during
or after the webinar.
Copyright 2017 Severalnines AB
2
About Severalnines and ClusterControl
Copyright 2017 Severalnines AB
3
What we do
Manage Scale
MonitorDeploy
Copyright 2017 Severalnines AB
4
ClusterControl Automation & Management
! Provisioning
! Deploy a cluster in minutes
! On-premises or in the cloud (AWS)
! Monitoring
! Systems view
! 1sec resolution
! DB / OS stats & performance advisors
! Configurable dashboards
! Query Analyzer
! Real-time / historical
! Management
! Multi cluster/data-center
! Automate repair/recovery
! Database upgrades
! Backups
! Configuration management
! Cloning
! One-click scaling
Copyright 2017 Severalnines AB
5
Supported Databases
Copyright 2017 Severalnines AB
6
Customers
Copyright 2017 Severalnines AB
MySQL & MariaDB load balancing with ProxySQL & ClusterControl:
introduction webinar
February 28, 2017
Krzysztof Książek
Severalnines
krzysztof@severalnines.com
René Cannaò
ProxySQL
rene@proxysql.com
7
Copyright 2017 Severalnines AB
8
Agenda
Copyright 2017 Severalnines AB
9
Agenda
! ProxySQL - introduction
! ProxySQL Internals
! Failover with ProxySQL
! Demo of ProxySQL support in ClusterControl
Copyright 2017 Severalnines AB
10
ProxySQL - introduction
Copyright 2017 Severalnines AB
11
Main motivations
! empower the DBAs
! improve operation
! understand and improve performance
! create a proxy layer to shield the database
! High performance and High Availability
Copyright 2017 Severalnines AB
12
! on-the-fly rewrite of queries
! caching reads outside the database
server
! connection pooling and multiplexing
! complex query routing and read/write split
! load balancing
! real time statistics
! monitoring
ProxySQL Features
! High Availability and Scalability
! seamless failover
! firewall
! query throttling
! query timeout
! query mirroring
! runtime reconfiguration
Copyright 2017 Severalnines AB
13
Hostgroups and Query Routing
! All backends are grouped into hostgroups
! Hostgroups have logical functionalities
Copyright 2017 Severalnines AB
14
Basic design
Copyright 2017 Severalnines AB
15
! HostGroup0 (HG0): Write masters
! HostGroup1( HG1): Read slaves
! Read/Write split
Example of hostgroup setups
! HG0: main write masters
! HG1: main read slaves
! HG2: reporting slaves
! HG3: ad-hoc queries slaves
! HG4: data warehouse write masters
! HG5: data warehouse read slaves
! HG6: remote site servers
! HG7: test servers
! HG8 : mirror for traffic on HG0
! HG9 : mirror for traffic on HG1
Copyright 2017 Severalnines AB
16
Basic design
Copyright 2017 Severalnines AB
17
Basic design
Copyright 2017 Severalnines AB
18
Clustered ProxySQL Architecture
Copyright 2017 Severalnines AB
19
Clustered ProxySQL at scale
! Tested with:
! 8 app servers with 3k clients’ connections each (24k total)
! 4 middle layer proxysqls processing 4k connections each from local proxysqls (16k total)
! 256 backends/shard (meaning 256 routing rules) processing 600 connections each (150k
total)
! Single ProxySQL was tested with up to 150k connections
! As today, ProxySQL is able to process up to 750k QPS
Copyright 2017 Severalnines AB
20
ProxySQL Internals
Copyright 2017 Severalnines AB
21
ProxySQL Modules
Copyright 2017 Severalnines AB
22
Queries Processor
! Based on Queries Rules
! Defines what to cache
! Defines the hostgroup target
! Timeout/delay
! Firewall
! Mirroring
! Rewrite queries
Copyright 2017 Severalnines AB
23
! Complex rules to match incoming traffic:
! regex on query
! regex on digest text
! username
! schemaname
Queries rules
! Complex rules to match incoming traffic:
! Source IP address
! Bind IP address/port
! digest
! Rules can be chained
Copyright 2017 Severalnines AB
24
! Caching on the wire
! Internal key/value storage
! In memory only
! Pattern based
! Expired by timeout
Queries Cache and Rewrite
! Rewrite on the wire
! Regex match/replace on query on digest text
! Optionally cached or mirrored
Copyright 2017 Severalnines AB
25
User Authentication
! Credentials stored in the proxy
! User login always possible (even without backends)
! Max connections
! Login credentials are encrypted
Copyright 2017 Severalnines AB
26
Hostgroups Manager
! Management of servers
! Track servers status
! Tightly integrated with the connections pool
Copyright 2017 Severalnines AB
27
Connection Pool
! Reduced the overhead of creating new connections, and are recycled when not in use
! One to many connections
! Multiplexing & maximum connections
! Auto-reconnect and automatic re-execution of queries
! Failover management
Copyright 2017 Severalnines AB
28
Auto-reconnect and re-execution
! Automatic detection of failures
! Graceful handling
! Auto-reconnect when possible
! Pause until a backend becomes available
! Re-execution of queries
Copyright 2017 Severalnines AB
29
Multiplexing
! Reduce the number of connections against mysqld (configurable)
! Many clients connections (tens of thousands) can use few backend connections (few hundreds)
! Tracks connection status (transactions, user variables, temporary tables, etc)
! Order by waiting time
Copyright 2017 Severalnines AB
30
Monitoring Module
! It monitors backends and collects metrics
! Monitors replication lag and shun hosts
! Monitors read_only variables (replication hostgroups)
! Ping and terminates unresponsive nodes
Copyright 2017 Severalnines AB
31
Failover with ProxySQL
Copyright 2017 Severalnines AB
32
Failover
! 2 phases process:
! remove host
! add host
! Seamless switchover:
! https://severalnines.com/blog/how-proxysql-adds-failover-and-query-control-your-mysql-replication-setup
! http://proxysql.blogspot.com/2015/09/proxysql-tutorial-seamless-replication.html
! Managed by external process
! Switchover in less than 1 second
Copyright 2017 Severalnines AB
33
Distributed failover
! Multiple ProxySQL are available in a network
! Failover managed by an external process that:
! remove host from each ProxySQL instance
! add new host into each ProxySQL instance
! Manager is not part of ProxySQL.
! ClusterControl can be used to detect master failure and perform a failover
Copyright 2017 Severalnines AB
34
Replication hostgroups
! Constantly monitor read_only variable
! Defines replication topology as writer(s)/readers(s)
! Automatically re-assign servers to the right hostgroup
! Possible to define unlimited number of replication clusters
Copyright 2017 Severalnines AB
35
Master switch with ClusterControl and ProxySQL
Copyright 2017 Severalnines AB
36
Failover highlight
! improve failover time as perceived by the application
! prevent errors sent to the application
! perform transparent database failovers: gracefully redirecting traffic without the application
knowing
! existing applications do not have to be rewritten to autoreconnect since connections are not
lost from failovers
Copyright 2017 Severalnines AB
37
Demo
Copyright 2017 Severalnines AB
38
Thank You!
! Severalnines resources on ProxySQL
! https://severalnines.com/blog/using-clustercontrol-deploy-and-configure-proxysql-top-mysql-replication
! https://severalnines.com/blog/sharding-mysql-mysql-fabric-and-proxysql
! https://severalnines.com/blog/how-proxysql-adds-failover-and-query-control-your-mysql-replication-setup
! https://severalnines.com/blog/how-set-read-write-split-galera-cluster-using-proxysql
! Install ClusterControl:
! https://severalnines.com/download-clustercontrol-database-management-system
! Contact: jj@severalnines.com

More Related Content

PDF
ProxySQL Tutorial - PLAM 2016
PPTX
Proxysql use case scenarios plam 2016
PDF
Proxysql ha plam_2016_2_keynote
PPTX
ProxySQL for MySQL
PDF
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
PDF
Nginx dhruba mandal
KEY
Nginx - Tips and Tricks.
PDF
Using NGINX as an Effective and Highly Available Content Cache
ProxySQL Tutorial - PLAM 2016
Proxysql use case scenarios plam 2016
Proxysql ha plam_2016_2_keynote
ProxySQL for MySQL
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
Nginx dhruba mandal
Nginx - Tips and Tricks.
Using NGINX as an Effective and Highly Available Content Cache

What's hot (19)

PDF
ProxySQL - High Performance and HA Proxy for MySQL
PPTX
5 things you didn't know nginx could do velocity
PDF
DockerCon Live 2020 - Securing Your Containerized Application with NGINX
PPTX
High Availability Content Caching with NGINX
PPTX
Benchmarking NGINX for Accuracy and Results
PDF
High Availability Content Caching with NGINX
PDF
Proxysql sharding
PPTX
NGINX High-performance Caching
PPTX
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
PDF
Lcu14 Lightning Talk- NGINX
PPTX
Maximizing PHP Performance with NGINX
ODP
Introduction to Nginx
PDF
ITB2017 - Nginx Effective High Availability Content Caching
PPTX
Delivering High Performance Websites with NGINX
PDF
What's New in NGINX Plus R12?
PPTX
Delivering High-Availability Web Services with NGINX Plus on AWS
PDF
Nginx Essential
PPTX
Learn nginx in 90mins
PPTX
NGINX 101 - now with more Docker
ProxySQL - High Performance and HA Proxy for MySQL
5 things you didn't know nginx could do velocity
DockerCon Live 2020 - Securing Your Containerized Application with NGINX
High Availability Content Caching with NGINX
Benchmarking NGINX for Accuracy and Results
High Availability Content Caching with NGINX
Proxysql sharding
NGINX High-performance Caching
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Lcu14 Lightning Talk- NGINX
Maximizing PHP Performance with NGINX
Introduction to Nginx
ITB2017 - Nginx Effective High Availability Content Caching
Delivering High Performance Websites with NGINX
What's New in NGINX Plus R12?
Delivering High-Availability Web Services with NGINX Plus on AWS
Nginx Essential
Learn nginx in 90mins
NGINX 101 - now with more Docker
Ad

Viewers also liked (14)

PDF
Tracxn Research - Mobile Advertising Landscape, February 2017
PPTX
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
PDF
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
PDF
Galera cluster for MySQL - Introduction Slides
PDF
Webinar slides: How to Secure MongoDB with ClusterControl
PDF
Tracxn Research - Healthcare Analytics Landscape, February 2017
PDF
2015 Internet Trends Report
PDF
Webinar slides: Top 9 Tips for building a stable MySQL Replication environment
DOC
Resume_ Prabhu Kannan_PM
PDF
Before the Open March 10 2017
PPTX
Comparing 30 MongoDB operations with Oracle SQL statements
PDF
Tracxn Research - Finance & Accounting Landscape, February 2017
PDF
Webinar: 10-Step Guide to Creating a Single View of your Business
PPTX
Google Cloud Spanner Preview
Tracxn Research - Mobile Advertising Landscape, February 2017
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
Galera cluster for MySQL - Introduction Slides
Webinar slides: How to Secure MongoDB with ClusterControl
Tracxn Research - Healthcare Analytics Landscape, February 2017
2015 Internet Trends Report
Webinar slides: Top 9 Tips for building a stable MySQL Replication environment
Resume_ Prabhu Kannan_PM
Before the Open March 10 2017
Comparing 30 MongoDB operations with Oracle SQL statements
Tracxn Research - Finance & Accounting Landscape, February 2017
Webinar: 10-Step Guide to Creating a Single View of your Business
Google Cloud Spanner Preview
Ad

Similar to Webinar slides: MySQL & MariaDB load balancing with ProxySQL & ClusterControl: introduction webinar (20)

PDF
Webinar slides: How to deploy and manage HAProxy, MaxScale or ProxySQL with C...
PDF
Webinar slides: How to automate and manage MongoDB & Percona Server for MongoDB
PPTX
Service Fabric
PDF
MySQL InnoDB Cluster - Meetup Oracle MySQL / AFUP Paris
PDF
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
PDF
Become a MySQL DBA - webinar series - slides: Which High Availability solution?
PDF
Webinar slides: Replication Topology Changes for MySQL and MariaDB
PDF
Using MongoDB to Build a Fast and Scalable Content Repository
PDF
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
PDF
Cisco Connect 2018 Vietnam - hyper flex
PPTX
[Cisco Connect 2018 - Vietnam] Long ton dc pss hyper flex
PDF
Open Source für den geschäftskritischen Einsatz
PDF
MySQL Load Balancers - MaxScale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
PDF
MySQL 5.7 InnoDB Cluster (Jan 2018)
PDF
Why MySQL High Availability Matters
PPTX
Red Hat Storage Day LA - Performance and Sizing Software Defined Storage
PDF
S903 palla
PDF
Webinar slides: Severalnines & MariaDB present: Automation & Management of Ma...
PDF
Webinar replay: MySQL Query Tuning Trilogy: Query tuning process and tools
PPTX
High Availability Using MySQL Group Replication
Webinar slides: How to deploy and manage HAProxy, MaxScale or ProxySQL with C...
Webinar slides: How to automate and manage MongoDB & Percona Server for MongoDB
Service Fabric
MySQL InnoDB Cluster - Meetup Oracle MySQL / AFUP Paris
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Become a MySQL DBA - webinar series - slides: Which High Availability solution?
Webinar slides: Replication Topology Changes for MySQL and MariaDB
Using MongoDB to Build a Fast and Scalable Content Repository
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
Cisco Connect 2018 Vietnam - hyper flex
[Cisco Connect 2018 - Vietnam] Long ton dc pss hyper flex
Open Source für den geschäftskritischen Einsatz
MySQL Load Balancers - MaxScale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL 5.7 InnoDB Cluster (Jan 2018)
Why MySQL High Availability Matters
Red Hat Storage Day LA - Performance and Sizing Software Defined Storage
S903 palla
Webinar slides: Severalnines & MariaDB present: Automation & Management of Ma...
Webinar replay: MySQL Query Tuning Trilogy: Query tuning process and tools
High Availability Using MySQL Group Replication

More from Severalnines (20)

PDF
The Long Term Cost of Managed DBaaS vs Sovereign DBaaS
PPTX
Sovereign DBaaS_ A Practical Vision for Self-Implementation of DBaaS.pptx
PDF
PostgreSQL on AWS Aurora/Azure Cosmos VS EC2/Azure VMs
PDF
Localhost Conference 2024_ Building a Flexible and Scalable Database Strategy...
PDF
SREDAY London 2024 | Cloud Native Technologies: The Building Blocks of Modern...
PDF
Building a Sovereign DBaaS on K8s OpenInfra Summit Asia 2024.pdf
PDF
S-DBaaS Community Call | Introduction to Sovereign DBaaS: The why, what and how
PDF
WEBINAR SLIDES: CCX for Cloud Service Providers
PPTX
LIVE DEMO: CCX for CSPs, a drop-in DBaaS solution
PDF
Kubernetes at Scale: Going Multi-Cluster with Istio
PDF
DIY DBaaS: A guide to building your own full-featured DBaaS
PDF
Cloud's future runs through Sovereign DBaaS
PPTX
Tips to drive maria db cluster performance for nextcloud
PPTX
Working with the Moodle Database: The Basics
PPTX
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
PDF
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
PDF
Webinar slides: How to Migrate from Oracle DB to MariaDB
PDF
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
PDF
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
PDF
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
The Long Term Cost of Managed DBaaS vs Sovereign DBaaS
Sovereign DBaaS_ A Practical Vision for Self-Implementation of DBaaS.pptx
PostgreSQL on AWS Aurora/Azure Cosmos VS EC2/Azure VMs
Localhost Conference 2024_ Building a Flexible and Scalable Database Strategy...
SREDAY London 2024 | Cloud Native Technologies: The Building Blocks of Modern...
Building a Sovereign DBaaS on K8s OpenInfra Summit Asia 2024.pdf
S-DBaaS Community Call | Introduction to Sovereign DBaaS: The why, what and how
WEBINAR SLIDES: CCX for Cloud Service Providers
LIVE DEMO: CCX for CSPs, a drop-in DBaaS solution
Kubernetes at Scale: Going Multi-Cluster with Istio
DIY DBaaS: A guide to building your own full-featured DBaaS
Cloud's future runs through Sovereign DBaaS
Tips to drive maria db cluster performance for nextcloud
Working with the Moodle Database: The Basics
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
(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 Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...

Recently uploaded (20)

PDF
Paper PDF World Game (s) Great Redesign.pdf
PDF
Testing WebRTC applications at scale.pdf
PPTX
SAP Ariba Sourcing PPT for learning material
PPTX
Internet___Basics___Styled_ presentation
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PDF
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
PPTX
E -tech empowerment technologies PowerPoint
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PPTX
Funds Management Learning Material for Beg
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PDF
Introduction to the IoT system, how the IoT system works
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
DOCX
Unit-3 cyber security network security of internet system
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
Paper PDF World Game (s) Great Redesign.pdf
Testing WebRTC applications at scale.pdf
SAP Ariba Sourcing PPT for learning material
Internet___Basics___Styled_ presentation
Decoding a Decade: 10 Years of Applied CTI Discipline
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
E -tech empowerment technologies PowerPoint
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
INTERNET------BASICS-------UPDATED PPT PRESENTATION
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
Funds Management Learning Material for Beg
Introuction about ICD -10 and ICD-11 PPT.pptx
Introduction to the IoT system, how the IoT system works
An introduction to the IFRS (ISSB) Stndards.pdf
WebRTC in SignalWire - troubleshooting media negotiation
Module 1 - Cyber Law and Ethics 101.pptx
522797556-Unit-2-Temperature-measurement-1-1.pptx
Unit-3 cyber security network security of internet system
PptxGenJS_Demo_Chart_20250317130215833.pptx
Slides PPTX World Game (s) Eco Economic Epochs.pptx

Webinar slides: MySQL & MariaDB load balancing with ProxySQL & ClusterControl: introduction webinar

  • 1. Copyright 2017 Severalnines AB 1 Your host & some logistics I'm Jean-Jérôme from the Severalnines Team and I'm your host for today's webinar! Feel free to ask any questions in the Questions section of this application or via the Chat box. You can also contact me directly via the chat box or via email: jj@severalnines.com during or after the webinar.
  • 2. Copyright 2017 Severalnines AB 2 About Severalnines and ClusterControl
  • 3. Copyright 2017 Severalnines AB 3 What we do Manage Scale MonitorDeploy
  • 4. Copyright 2017 Severalnines AB 4 ClusterControl Automation & Management ! Provisioning ! Deploy a cluster in minutes ! On-premises or in the cloud (AWS) ! Monitoring ! Systems view ! 1sec resolution ! DB / OS stats & performance advisors ! Configurable dashboards ! Query Analyzer ! Real-time / historical ! Management ! Multi cluster/data-center ! Automate repair/recovery ! Database upgrades ! Backups ! Configuration management ! Cloning ! One-click scaling
  • 5. Copyright 2017 Severalnines AB 5 Supported Databases
  • 7. Copyright 2017 Severalnines AB MySQL & MariaDB load balancing with ProxySQL & ClusterControl: introduction webinar February 28, 2017 Krzysztof Książek Severalnines krzysztof@severalnines.com René Cannaò ProxySQL rene@proxysql.com 7
  • 9. Copyright 2017 Severalnines AB 9 Agenda ! ProxySQL - introduction ! ProxySQL Internals ! Failover with ProxySQL ! Demo of ProxySQL support in ClusterControl
  • 10. Copyright 2017 Severalnines AB 10 ProxySQL - introduction
  • 11. Copyright 2017 Severalnines AB 11 Main motivations ! empower the DBAs ! improve operation ! understand and improve performance ! create a proxy layer to shield the database ! High performance and High Availability
  • 12. Copyright 2017 Severalnines AB 12 ! on-the-fly rewrite of queries ! caching reads outside the database server ! connection pooling and multiplexing ! complex query routing and read/write split ! load balancing ! real time statistics ! monitoring ProxySQL Features ! High Availability and Scalability ! seamless failover ! firewall ! query throttling ! query timeout ! query mirroring ! runtime reconfiguration
  • 13. Copyright 2017 Severalnines AB 13 Hostgroups and Query Routing ! All backends are grouped into hostgroups ! Hostgroups have logical functionalities
  • 14. Copyright 2017 Severalnines AB 14 Basic design
  • 15. Copyright 2017 Severalnines AB 15 ! HostGroup0 (HG0): Write masters ! HostGroup1( HG1): Read slaves ! Read/Write split Example of hostgroup setups ! HG0: main write masters ! HG1: main read slaves ! HG2: reporting slaves ! HG3: ad-hoc queries slaves ! HG4: data warehouse write masters ! HG5: data warehouse read slaves ! HG6: remote site servers ! HG7: test servers ! HG8 : mirror for traffic on HG0 ! HG9 : mirror for traffic on HG1
  • 16. Copyright 2017 Severalnines AB 16 Basic design
  • 17. Copyright 2017 Severalnines AB 17 Basic design
  • 18. Copyright 2017 Severalnines AB 18 Clustered ProxySQL Architecture
  • 19. Copyright 2017 Severalnines AB 19 Clustered ProxySQL at scale ! Tested with: ! 8 app servers with 3k clients’ connections each (24k total) ! 4 middle layer proxysqls processing 4k connections each from local proxysqls (16k total) ! 256 backends/shard (meaning 256 routing rules) processing 600 connections each (150k total) ! Single ProxySQL was tested with up to 150k connections ! As today, ProxySQL is able to process up to 750k QPS
  • 20. Copyright 2017 Severalnines AB 20 ProxySQL Internals
  • 21. Copyright 2017 Severalnines AB 21 ProxySQL Modules
  • 22. Copyright 2017 Severalnines AB 22 Queries Processor ! Based on Queries Rules ! Defines what to cache ! Defines the hostgroup target ! Timeout/delay ! Firewall ! Mirroring ! Rewrite queries
  • 23. Copyright 2017 Severalnines AB 23 ! Complex rules to match incoming traffic: ! regex on query ! regex on digest text ! username ! schemaname Queries rules ! Complex rules to match incoming traffic: ! Source IP address ! Bind IP address/port ! digest ! Rules can be chained
  • 24. Copyright 2017 Severalnines AB 24 ! Caching on the wire ! Internal key/value storage ! In memory only ! Pattern based ! Expired by timeout Queries Cache and Rewrite ! Rewrite on the wire ! Regex match/replace on query on digest text ! Optionally cached or mirrored
  • 25. Copyright 2017 Severalnines AB 25 User Authentication ! Credentials stored in the proxy ! User login always possible (even without backends) ! Max connections ! Login credentials are encrypted
  • 26. Copyright 2017 Severalnines AB 26 Hostgroups Manager ! Management of servers ! Track servers status ! Tightly integrated with the connections pool
  • 27. Copyright 2017 Severalnines AB 27 Connection Pool ! Reduced the overhead of creating new connections, and are recycled when not in use ! One to many connections ! Multiplexing & maximum connections ! Auto-reconnect and automatic re-execution of queries ! Failover management
  • 28. Copyright 2017 Severalnines AB 28 Auto-reconnect and re-execution ! Automatic detection of failures ! Graceful handling ! Auto-reconnect when possible ! Pause until a backend becomes available ! Re-execution of queries
  • 29. Copyright 2017 Severalnines AB 29 Multiplexing ! Reduce the number of connections against mysqld (configurable) ! Many clients connections (tens of thousands) can use few backend connections (few hundreds) ! Tracks connection status (transactions, user variables, temporary tables, etc) ! Order by waiting time
  • 30. Copyright 2017 Severalnines AB 30 Monitoring Module ! It monitors backends and collects metrics ! Monitors replication lag and shun hosts ! Monitors read_only variables (replication hostgroups) ! Ping and terminates unresponsive nodes
  • 31. Copyright 2017 Severalnines AB 31 Failover with ProxySQL
  • 32. Copyright 2017 Severalnines AB 32 Failover ! 2 phases process: ! remove host ! add host ! Seamless switchover: ! https://severalnines.com/blog/how-proxysql-adds-failover-and-query-control-your-mysql-replication-setup ! http://proxysql.blogspot.com/2015/09/proxysql-tutorial-seamless-replication.html ! Managed by external process ! Switchover in less than 1 second
  • 33. Copyright 2017 Severalnines AB 33 Distributed failover ! Multiple ProxySQL are available in a network ! Failover managed by an external process that: ! remove host from each ProxySQL instance ! add new host into each ProxySQL instance ! Manager is not part of ProxySQL. ! ClusterControl can be used to detect master failure and perform a failover
  • 34. Copyright 2017 Severalnines AB 34 Replication hostgroups ! Constantly monitor read_only variable ! Defines replication topology as writer(s)/readers(s) ! Automatically re-assign servers to the right hostgroup ! Possible to define unlimited number of replication clusters
  • 35. Copyright 2017 Severalnines AB 35 Master switch with ClusterControl and ProxySQL
  • 36. Copyright 2017 Severalnines AB 36 Failover highlight ! improve failover time as perceived by the application ! prevent errors sent to the application ! perform transparent database failovers: gracefully redirecting traffic without the application knowing ! existing applications do not have to be rewritten to autoreconnect since connections are not lost from failovers
  • 38. Copyright 2017 Severalnines AB 38 Thank You! ! Severalnines resources on ProxySQL ! https://severalnines.com/blog/using-clustercontrol-deploy-and-configure-proxysql-top-mysql-replication ! https://severalnines.com/blog/sharding-mysql-mysql-fabric-and-proxysql ! https://severalnines.com/blog/how-proxysql-adds-failover-and-query-control-your-mysql-replication-setup ! https://severalnines.com/blog/how-set-read-write-split-galera-cluster-using-proxysql ! Install ClusterControl: ! https://severalnines.com/download-clustercontrol-database-management-system ! Contact: jj@severalnines.com