Proxies are building blocks of HA setups for MySQL & MariaDB. They can detect failed nodes and route queries to hosts which are still available. If your master failed and you had to promote one of your slaves, proxies will detect such topology changes and route your traffic accordingly. More advanced proxies can do much more: route traffic based on precise query rules, cache queries or mirror them. They can be even used to implement different types of sharding.
Introducing ProxySQL!
In this joint webinar with ProxySQL’s creator, René Cannaò, we discuss this new proxy and its key features. We show you how you can deploy ProxySQL using ClusterControl. And we give you an early walk-through of some of the exciting ClusterControl features for ProxySQL that we have planned for its next release.
AGENDA
1. Introduction
2. ProxySQL concepts (René Cannaò)
- Hostgroups
- Query rules
- Connection multiplexing
- Configuration management
3. Demo of ProxySQL setup in ClusterControl (Krzysztof Książek)
4. Upcoming ClusterControl features for ProxySQL
SPEAKERS
René Cannaò, Creator & Founder, ProxySQL. René has 10 years of working experience as a System, Network and Database Administrator mainly on Linux/Unix platform. In the last 4-5 years his experience was focused mainly on MySQL, working as Senior MySQL Support Engineer at Sun/Oracle and then as Senior Operational DBA at Blackbird, (formerly PalominoDB). In this period he built an analytic and problem solving mindset and he is always eager to take on new challenges, especially if they are related to high performance. And then he created ProxySQL…
Krzysztof Książek, Senior Support Engineer at Severalnines, is a MySQL DBA with experience managing complex database environments for companies like Zendesk, Chegg, Pinterest and Flipboard.
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
MySQL Load Balancing with ProxySQL & ClusterControl 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.
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
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
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
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
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
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