Percona XtraDB Cluster 5.7 Enhancements Performance, Security, and More Michael Coburn, Product Manager, PMM Percona Live Dublin 2017 1
Your Presenter Product Manager for PMM (Percona Monitoring and Management) At Percona for ~5 years through 6 different roles Consultant, Managing Consultant, Principal Architect, Technical Account Manager, Principal Support Engineer Living in México Will be at AWS re:invent in November! 2
Agenda What is it, why is it unique, and what limitations exist What makes it unique as an HA solution What's new in PXC 5.7 PXC + ProxySQL PXC + PMM 3
PXC refresher What has gone before 4
Setting the stage PXC is Virtually-synchronous multi-master database cluster Direct reads and writes to any node Highly Available - lose any individual node without interruption No complex failover procedures Enhanced options Improved Commit Monitor Bug-fixes, PXC Strict mode 5
Use cases Environments with strict durability requirements Partitioned node will refuse reads/writes Write to multiple nodes simultaneously while keeping data consistent Flow control throttles writes so that slow applier nodes can catch up Reduced failover time Partitioned node will automatically recover and re-join the cluster Weighted Quorum segments for WAN, optional to use Arbitrator role 6
Limitations Large and long-running transactions higher chance of failure non-efficient replication of large transactions Hotspots updating same set of rows in parallel General method of resolution - write to just 1 node in the cluster 7
What's unique about PXC Versus Galera, MariadB Cluster, InnoDB Group Replication (GR) 8
PXC vs MariaDB Cluster vs InnoDB GR Galera/MariaDB Cluster PXC Automatic Node Provisioning Load Balancer Integration Enforcing Best Practices Mature Technology Multi-Master WAN Support Performance Supported by Percona 9 InnoDB GR
Improved Commit Monitor pre-commit hook split into two actions: replicate (storage engine PREPARE stage) add write-set to group-channel pre-commit enter commit-monitor, to enforce commit ordering of transactions released once transaction added to flush-stage of group commit (interim-commit) with log-bin off, released before REDO flush stage begins 10
PXC strict mode Only allow InnoDB operations Disallow binlog_format!=row Requires Primary Key on tables Disables unsupported features GET_LOG, LOCK TABLES FLUSH TABLES WITH READ LOCK tx_isolation=serializable 11
PXC security a. Secure the network b. Encrypt PXC traffic c. Encrypt data at rest 12
PXC security - network 13 Use a firewall on each node 3306 is used for MySQL client connections and SST (State Snapshot Transfer) via mysqldump. 4444 is used for SST via rsync and Percona XtraBackup. 4567 is used for write-set replication traffic (over TCP) and multicast replication (over TCP and UDP). 4568 is used for IST (Incremental State Transfer).
PXC security - encrypted PXC traffic Generate keys Certificate Authority (CA) key and certificate Server key and certificate Client key and certificate Enable encryption Database traffic MySQL client SSL Replication traffic Write Set IST - Incremental State Transfer Service messages (node sync) SST - State Snapshot Transfer 14 rsync, mysqldump, xtrabackup pxc-encrypt-cluster-traffic=on Automatic enabling of SSL, but need the certificates in place beforehand
PXC security - Encrypt data at rest Using MySQL's InnoDB Tablespace Encryption Two tier encryption key architecture master encryption key tablespace keys Defined during CREATE TABLE ENCRYPTION = 'Y'; 15
What's new in PXC 16
PXC 5.7 Latest is PXC 5.7.19 - Sept 22, 2017 Version compatibility check added If donor is 5.6 and joiner is 5.7: A warning is printed to perform mysql_upgrade If donor is 5.7 and joiner is 5.6: An error is printed and SST is rejected performance_schema.pxc_cluster_view Support for PXB 2.4.7 wresp_debug flag encrypt-threads backup-threads (--parallel) 17
OLTP concurrency improvements Multiple threads using OLTP_RW, UPDATE_KEY, and UPDATE_NOKEY tests with single writer New defaults gcs.fc_limit=100 (was 16) evs.send_window=10 (was 4) evs.user_send_window=4 (was 2) sync_binlog=1 in this test 18
Performance from 5.7.16 to 5.7.17 log-bin off 19
Cluster node joining speed Test case: Shut down one node Create single table with sysbench Start the node and re-join Smaller is better 20
New status variables WSREP tracking wsrep_flow_control_interval_{low,high} wsrep_ist_receive_seqno_{start,current,end} 21
End of Life'd platforms August 2017 Red Hat Enterprise Linux 5 (Tikanga) Ubuntu 12.04 LTS (Precise Pangolin) 22
PXC + ProxySQL Load balancer for PXC 23
PXC + ProxySQL ProxySQL - a high-performance SQL proxy Runs as a daemon watched by a monitoring process ProxySQL supports Percona XtraDB Cluster node status check using scheduler 24
PXC + ProxySQL proxysql-admin Configure PXC nodes in ProxySQL - singlewrite or loadbal ProxySQL schedulers Health checks - cluster node membership and desynced state, re-configure nodes PXC maintenance mode pxc_main_mode=maintenance SHUTDOWN Marks node as OFFLINE vs OFFLINE_SOFT proxysql-admin checks this and configures ProxySQL to rebalance traffic 25
Configuring ProxySQL 26
PXC + PMM You knew this was coming.. didn't my title of Product Manager for PMM give it away?! 27
PXC/Galera graphs - 1 28
PXC/Galera Graphs - 2 29
PXC/Galera Cluster Overview - 1 30
PXC/Galera Cluster Overview - 2 31
ProxySQL - 1 32
ProxySQL - 2 33
Thank You Sponsors! 34
SAVE THE DATE! April 23-25, 2018 Santa Clara Convention Center CALL FOR PAPERS OPENING SOON! 35 www.perconalive.com
Talk to Percona Experts at AWS re:invent! Database Performance for Cloud Deployments Percona Support and Managed Services Amazon RDS, Aurora, Roll Your Own MySQL/MariaDB/MongoDB Reduce costs and optimize performance Percona Monitoring and Management Demos Point-in-time visibility and historical trending of database performance Detailed query analytics Booth #1138 36
Rate this session 37
DATABASE PERFORMANCE Database Performance Matters MATTERS