SlideShare a Scribd company logo
© 2019 Percona1
Marcelo Altmann
ProxySQL para MySQL
Mais que um simples proxy - Exemplos de uso
Senior Support Engineer
Percona University - São Paulo
27/04/2019
© 2019 Percona2
Agenda
© 2019 Percona3
Agenda
▪Sobre Mim
▪Introdução
▪Features
▪Caso de uso
© 2019 Percona4
Sobre Mim
© 2019 Percona5
Marcelo Altmann
▪Engenheiro de Suporte @ percona
• MySQL DBA @ IEDR (CCTLD Irlanda)
▪Tecnologo em Sistemas para
Internet
▪Oracle ACE Associate
▪blog.marceloaltmann.com
▪Certificaçoes
• OCP, MySQL 5.7 Database Administrator
• OCP, MySQL 5.6 Database Administrator
• OCP, MySQL 5.6 Developer
• OCP, MySQL 5 Database Administrator
• OCP, MySQL 5 Developer
• OCP, MySQL 5.0/5.1/5.5
© 2019 Percona6
ProxySQL - Introdução
© 2019 Percona7
ProxySQL - Introdução
▪Criado e mantido por René Cannaò
• MySQL Community - Contribuidor do ano (2017)
• MySQL Community - Software do ano (2018)
• MySQL Community Contributor Award - Oracle (2019)
▪Open Source
• http://www.proxysql.com/
• https://github.com/sysown/proxysql
© 2019 Percona8
ProxySQL - Introdução
▪Instalação
• Source Code / rpm / deb / percona repo (yum / apt-get)
▪MySQL admin interface
[root@localhost ~]# mysql -u admin -padmin -P 6032 -h 127.0.0.1 --prompt='Admin> '
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.5.30 (ProxySQL Admin Module)
. . .
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
Admin>
© 2019 Percona9
ProxySQL - Introdução
▪Camadas
• Runtime - Dados que o proxySQL acessa
• Main/Memory - Camada onde executamos alterações e monitoramento
• Disk - Camada para persistir dados. SQLite3
© 2019 Percona10
ProxySQL - Introdução
+-------------------------+
| 1. RUNTIME | <- processo proxysql
+-------------------------+
/| |
| |
| |/
+-------------------------+
| 2. MEMORY | <- DML
+-------------------------+
/| |
| |
| |/
+-------------------------+
| 3. DISK | <- /var/lib/proxysql/proxysql.db
+-------------------------+
© 2019 Percona11
ProxySQL - Introdução
▪Tabelas
• mysql_servers - Contém a lista de servidores e HG (Host Group)
mysql> SELECT hostgroup_id, hostname, status, comment FROM mysql_servers;
+--------------+----------+--------+---------+
| hostgroup_id | hostname | status | comment |
+--------------+----------+--------+---------+
| 10 | node1 | ONLINE | WRITE |
| 11 | node2 | ONLINE | READ |
| 11 | node3 | ONLINE | READ |
+--------------+----------+--------+---------+
© 2019 Percona12
ProxySQL - Introdução
▪Tabelas
• mysql_users - Contém a lista de usuário para autenticação.
mysql> SELECT username, default_hostgroup FROM
mysql_users;
+---------------+-------------------+
| username | default_hostgroup |
+---------------+-------------------+
| proxysql_user | 10 |
+---------------+-------------------+
1 row in set (0.00 sec)
© 2019 Percona13
ProxySQL - Introdução
▪Tabelas
• mysql_query_rules - Contém a lista de regras para cache, reescrita e redirecionamento
de queries.
© 2019 Percona14
ProxySQL - Features - Load Balance
© 2019 Percona15
ProxySQL - Features - Load Balance
▪Usuários de autenticação
Admin> INSERT INTO mysql_users (username,password,default_hostgroup) VALUES ('proxysql_user','Pr0xySQL!',10);
Query OK, 1 row affected (0.00 sec)
Admin> LOAD MYSQL USERS TO RUNTIME ;
Query OK, 0 rows affected (0.00 sec)
Admin> SAVE MYSQL USERS FROM RUNTIME; -- Hack para o plain-text password
Query OK, 0 rows affected (0.00 sec)
Admin> SAVE MYSQL USERS TO DISK ;
Query OK, 0 rows affected (0.01 sec)
© 2019 Percona16
ProxySQL - Features - Load Balance
▪Redirecionamento do tráfego para lista de servidores
Admin> INSERT INTO mysql_servers (hostname, hostgroup_id, comment) VALUES
('node1',10,'WRITE'),('node2',11,'READ'),('node3',11,'READ');
Query OK, 3 rows affected (0.00 sec)
Admin> LOAD MYSQL SERVERS TO RUNTIME;
Query OK, 0 rows affected (0.01 sec)
Admin> SAVE MYSQL SERVERS TO DISK;
Query OK, 0 rows affected (0.02 sec)
Admin> SELECT hostgroup_id, hostname, status, comment FROM mysql_servers;
+--------------+----------+--------+---------+
| hostgroup_id | hostname | status | comment |
+--------------+----------+--------+---------+
| 10 | node1 | ONLINE | WRITE |
| 11 | node2 | ONLINE | READ |
| 11 | node3 | ONLINE | READ |
+--------------+----------+--------+---------+
3 rows in set (0.00 sec)
© 2019 Percona17
ProxySQL - Features - Load Balance
▪Dividir leituras e escritas
Admin> INSERT INTO mysql_query_rules (username,destination_hostgroup,active,match_digest,apply)
-> VALUES
-> ('proxysql_user',10,1,'^SELECT.*FOR UPDATE',1),
-> ('proxysql_user',11,1,'^SELECT ',1);
Query OK, 2 rows affected (0.00 sec)
Admin> LOAD MYSQL QUERY RULES TO RUNTIME; SAVE MYSQL QUERY RULES TO DISK;
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.01 sec)
© 2019 Percona18
ProxySQL - Features - Load Balance
▪Dividir leituras e escritas
[root@localhost ~]# mysql -u proxysql_user -p'Pr0xySQL!' -P 6033 -h 127.0.0.1 -e "INSERT INTO test.t1 VALUES
(@@hostname)"
[root@localhost ~]# mysql -u proxysql_user -p'Pr0xySQL!' -P 6033 -h 127.0.0.1 -e "SELECT @@hostname, server
FROM test.t1"
+------------+--------+
| @@hostname | server |
+------------+--------+
| node2 | node1 |
+------------+--------+
[root@localhost ~]# mysql -u proxysql_user -p'Pr0xySQL!' -P 6033 -h 127.0.0.1 -e "SELECT @@hostname, server
FROM test.t1"
+------------+--------+
| @@hostname | server |
+------------+--------+
| node3 | node1 |
+------------+--------+
© 2019 Percona19
ProxySQL - Features - Failover
© 2019 Percona20
ProxySQL - Features - Failover
▪Replicação
• Mysql_replication_hostgroups - Validar a variável read_only no MySQL
Admin> INSERT INTO mysql_replication_hostgroups
(writer_hostgroup, reader_hostgroup) VALUES (10, 11);
Admin> LOAD MYSQL SERVERS TO RUNTIME; SAVE MYSQL SERVERS
TO DISK;
© 2019 Percona21
ProxySQL - Features - Failover
▪Percona XtraDB Cluster / Galera
• Scheduler - Script que roda a cada X milisegundos
▪https://github.com/percona/proxysql-admin-tool
▪Modos
• Single Write
• Load Balance
© 2019 Percona22
ProxySQL - Features - Failover
▪Mysql_galera_hostgroups (proxysql 2.0)
• Writer_hostgroup
• Backup_writer_hostgroup
• Reader_hostgroup
• Offline_hostgroup
© 2019 Percona23
ProxySQL - Features - Connection Pool
© 2019 Percona24
ProxySQL - Features - Connection Pool
© 2019 Percona25
ProxySQL - Features - Connection Pool
© 2019 Percona26
ProxySQL - Features - Connection Pool
© 2019 Percona27
ProxySQL - Features - Connection Pool
© 2019 Percona28
ProxySQL - Features - Multiplexing
© 2019 Percona29
ProxySQL - Features - Multiplexing
© 2019 Percona30
ProxySQL - Features - Multiplexing
© 2019 Percona31
ProxySQL - Features - Multiplexing
© 2019 Percona32
ProxySQL - Features - Stats
© 2019 Percona33
ProxySQL - Features - Stats
▪SHOW TABLES FROM stats;
• Stats_mysql_commands_counters - Contador baseado em comandos
• Stats_mysql_connection_pool - Conexoes por servidor
• Stats_mysql_global - Estatisticas globais
• Stats_mysql_processlist - SHOW PROCESSLIST
• Stats_mysql_query_digest - Contador agrupado por digest
• Stats_mysql_query_rules - Contador baseado nas query rules
© 2019 Percona34
ProxySQL - Features - Reescrita de Query
© 2019 Percona35
ProxySQL - Features - Reescrita de query
▪stats_mysql_query_digest
Admin> SELECT digest, digest_text, sum_time FROM stats_mysql_query_digest ORDER BY sum_time DESC LIMIT 1;
+--------------------+-----------------------------------------+----------+
| digest | digest_text | sum_time |
+--------------------+-----------------------------------------+----------+
| 0xD69E622A5052289E | SELECT * FROM world.city WHERE Name = ? | 7016461 |
+--------------------+-----------------------------------------+----------+
Admin> INSERT INTO mysql_query_rules (rule_id,active,match_pattern, replace_pattern) VALUES (3,1,
'^SELECT * FROM world.city WHERE Name = (.*)$',
'SELECT Population FROM world.city WHERE Name = 1');
Query OK, 1 row affected (0.00 sec)
Admin> LOAD MYSQL QUERY RULES TO RUNTIME;
Query OK, 0 rows affected (0.01 sec)
Admin> SAVE MYSQL QUERY RULES TO DISK;
Query OK, 0 rows affected (0.01 sec)
© 2019 Percona36
ProxySQL - Features - Reescrita de query
[root@localhost ~]# mysql -u proxysql_user -p'Pr0xySQL!' -P 6033 -h 127.0.0.1 -e "SELECT * FROM world.city
WHERE Name = 'São Paulo'"
+------------+
| Population |
+------------+
| 9968485 |
+------------+
© 2019 Percona37
ProxySQL - Features - Firewall
© 2019 Percona38
ProxySQL - Features - Firewall
▪Bloquear queries - SQL INJECTION!
• Original query: SELECT Name FROM world.city WHERE Name = ‘?’
• SQL Injection: ? = São Paulo' OR ID > 0; --
• SELECT Name FROM world.city WHERE Name = 'São Paulo' OR ID > 0; --'
Admin> SELECT username, digest, digest_text FROM stats_mysql_query_digest WHERE digest_text LIKE '% OR ID %'
ORDER BY first_seen DESC LIMIT 1;
+-------------+--------------------+------------------------------------------------------+
| username | digest | digest_text |
+-------------+--------------------+------------------------------------------------------+
| application | 0xD8AF41BF32707ABD | SELECT Name FROM world.city WHERE Name = ? OR ID > ? |
+-------------+--------------------+------------------------------------------------------+
1 row in set (0.00 sec)
© 2019 Percona39
ProxySQL - Features - Firewall
Admin> INSERT INTO mysql_query_rules (rule_id, active, digest, error_msg, apply) VALUES
(4,1,'0xD8AF41BF32707ABD','Suspeita de SQL Injection',1);
Query OK, 1 row affected (0.00 sec)
Admin> LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
Query OK, 0 rows affected (0.01 sec)
Query OK, 0 rows affected (0.01 sec)
[root@localhost ~]# mysql -u application -papp -P 6033 -h 127.0.0.1 -e "SELECT Name FROM
world.city WHERE Name = 'São Paulo' OR ID > 0; --' "
ERROR 1148 (42000) at line 1: Suspeita de SQL Injection
© 2019 Percona40
ProxySQL - Features - Espelhamento de Query
© 2019 Percona41
ProxySQL - Features - Mirror
▪Espelhar queries em outros servidores
• Testar configurações
• Standby Master - Manter buffer pool quente
• Testar workload em versões diferentes - Upgrades
• Troubleshooting
© 2019 Percona42
ProxySQL - Features - Mirror
▪Esquentar buffer pool
Admin> INSERT INTO mysql_servers (hostgroup_id, hostname) VALUES (12, 'node4');
Admin> LOAD MYSQL SERVERS TO RUNTIME; SAVE MYSQL SERVERS TO DISK;
Admin> SELECT rule_id, match_digest, destination_hostgroup, mirror_hostgroup FROM
mysql_query_rules WHERE rule_id=2;
+---------+--------------+-----------------------+------------------+
| rule_id | match_digest | destination_hostgroup | mirror_hostgroup |
+---------+--------------+-----------------------+------------------+
| 2 | ^SELECT | 11 | NULL |
+---------+--------------+-----------------------+------------------+
Admin> UPDATE mysql_query_rules SET mirror_hostgroup=12 WHERE rule_id=2;
Admin> LOAD MYSQL QUERY RULES TO RUNTIME;
Admin> SAVE MYSQL QUERY RULES TO DISK;
© 2019 Percona43
ProxySQL - Features - Query Cache
© 2019 Percona44
ProxySQL - Features - Query Cache
▪Cache de queries baseado em TTL
[root@localhost ~]# sysbench --num-threads=16 --max-requests=0 --max-time=60 --test=/usr/share/doc/sysbench/tests/db/oltp.lua
--mysql-user=application --mysql-password=app --mysql-db=test --mysql-host=127.0.0.1 --mysql-port=6033 --oltp-table-size=10000
--oltp-read-only=on --oltp-skip-trx=on --oltp-point-selects=100 --oltp-simple-ranges=1 --oltp-sum-ranges=1 --oltp-order-ranges=1
--oltp-distinct-ranges=1 run | grep 'read/write requests'
read/write requests: 105664 (1744.81 per sec.)
Admin> SELECT count_star,sum_time,hostgroup,digest,digest_text FROM stats_mysql_query_digest ORDER BY sum_time DESC;
+--------------+-----------+-----------+--------------------+-----------------------------------------------------------------------+
| count_star | sum_time | hostgroup | digest | digest_text
|
+--------------+-----------+-----------+--------------------+-----------------------------------------------------------------------+
| 100200 | 459147213 | 11 | 0xBF001A0C13781C1D | SELECT c FROM sbtest1 WHERE id=?
|
| 1002 | 6533622 | 11 | 0xF7D3CD60704822A0 | SELECT DISTINCT c FROM sbtest1 WHERE id BETWEEN ? AND ?+? ORDER BY c |
| 1002 | 6061540 | 11 | 0x877EEAAFADF3DDF2 | SELECT c FROM sbtest1 WHERE id BETWEEN ? AND ?+? ORDER BY c
|
| 1002 | 5905677 | 11 | 0xAF7A51977DD56217 | SELECT c FROM sbtest1 WHERE id BETWEEN ? AND ?+?
|
| 1002 | 5321376 | 11 | 0x3E268CF3E75DB831 | SELECT SUM(K) FROM sbtest1 WHERE id BETWEEN ? AND ?+?
|
+--------------+-----------+-----------+--------------------+-----------------------------------------------------------------------+
© 2019 Percona45
ProxySQL - Features - Query Cache
Admin> INSERT INTO mysql_query_rules (rule_id,active,digest,cache_ttl,apply) VALUES (5,1, '0xBF001A0C13781C1D' ,2000,1);
Query OK, 1 row affected (0.00 sec)
Admin> LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
[root@localhost ~]# sysbench --num-threads=16 --max-requests=0 --max-time=60 --test=/usr/share/doc/sysbench/tests/db/oltp.lua
--mysql-user=application --mysql-password=app --mysql-db=test --mysql-host=127.0.0.1 --mysql-port=6033 --oltp-table-size=10000
--oltp-read-only=on --oltp-skip-trx=on --oltp-point-selects=100 --oltp-simple-ranges=1 --oltp-sum-ranges=1 --oltp-order-ranges=1
--oltp-distinct-ranges=1 run | grep 'read/write requests'
read/write requests: 238680 (3956.42 per sec.)
Admin> SELECT count_star,sum_time,hostgroup,digest,digest_text FROM stats_mysql_query_digest ORDER BY sum_time DESC;
+------------+-----------+-----------+--------------------+----------------------------------------------------------------------+
| count_star | sum_time | hostgroup | digest | digest_text |
+------------+-----------+-----------+--------------------+----------------------------------------------------------------------+
| 140512 | 632180517 | 11 | 0xBF001A0C13781C1D | SELECT c FROM sbtest1 WHERE id=? |
| 3372 | 18351846 | 11 | 0xF7D3CD60704822A0 | SELECT DISTINCT c FROM sbtest1 WHERE id BETWEEN ? AND ?+? ORDER BY c |
| 3372 | 17739689 | 11 | 0x877EEAAFADF3DDF2 | SELECT c FROM sbtest1 WHERE id BETWEEN ? AND ?+? ORDER BY c |
| 3372 | 17709660 | 11 | 0xAF7A51977DD56217 | SELECT c FROM sbtest1 WHERE id BETWEEN ? AND ?+? |
| 3372 | 15646777 | 11 | 0x3E268CF3E75DB831 | SELECT SUM(K) FROM sbtest1 WHERE id BETWEEN ? AND ?+? |
| 196688 | 0 | -1 | 0xBF001A0C13781C1D | SELECT c FROM sbtest1 WHERE id=? |
+------------+-----------+-----------+--------------------+----------------------------------------------------------------------+
© 2019 Percona46
ProxySQL - Features - GTID Leituras
Consistentes
© 2019 Percona47
ProxySQL 2.0 - GTID Leituras Consistentes
▪Stale reads
▪Requer modificações na aplicação
• WAIT_FOR_EXECUTED_GTID_SET
• Verificar multiplos slaves
• Nenhum slave em sync
© 2019 Percona48
ProxySQL 2.0 - GTID Leituras Consistentes
▪MySQL 5.7.5+ - session_track_gtids
▪Verificar GTID no slave?
• Pull - Verificar slaves em intervalos
• Push - Slaves notificam o ProxySQL
© 2019 Percona49
ProxySQL 2.0 - GTID Leituras Consistentes
▪ProxySQL Binlog Reader
• https://github.com/sysown/proxysql_mysqlbinlog
© 2019 Percona50
ProxySQL 2.0 - GTID Leituras Consistentes
© 2019 Percona51
ProxySQL 2.0 - GTID Leituras Consistentes
01:29:54.081552 IP (tos 0x0, ttl 64, id 25059, offset 0, flags [DF], proto TCP (6), length 100)
marcelo-altmann-PU-replication-1.lxd.opsession-prxy > marcelo-altmann-PU-proxysql-1.lxd.41726: Flags [P.], cksum
0x5dfd (incorrect -> 0xc8cb), seq 1:49, ack 1, win 510, options [nop,nop,TS val 792525047 ecr 430181741],length
48
0x0000: 4500 0064 61e3 4000 4006 7b0a ac10 025f E..da.@.@.{...._
0x0010: ac10 0327 0ceb a2fe c48c 6725 bf6c 4c56 ...'......g%.lLV
0x0020: 8018 01fe 5dfd 0000 0101 080a 2f3c f8f7 ....]......./<..
0x0030: 19a4 0d6d 5354 3d64 6131 6262 3030 302d ...mST=da1bb000-
0x0040: 3563 3963 2d31 3165 392d 3965 6537 2d30 5c9c-11e9-9ee7-0
0x0050: 3031 3633 6566 6162 6163 303a 312d 3535 0163efabac0:1-55
0x0060: 3239 390a 299.
mysql> SHOW GLOBAL VARIABLES LIKE 'gtid_executed';
+---------------+----------------------------------------------+
| Variable_name | Value |
+---------------+----------------------------------------------+
| gtid_executed | da1bb000-5c9c-11e9-9ee7-00163efabac0:1-55299 |
+---------------+----------------------------------------------+
1 row in set (0.00 sec)
© 2019 Percona52
ProxySQL 2.0 - GTID Leituras Consistentes
01:30:26.066393 IP (tos 0x0, ttl 64, id 25060, offset 0, flags [DF], proto TCP (6), length 94)
marcelo-altmann-PU-replication-1.lxd.opsession-prxy > marcelo-altmann-PU-proxysql-1.lxd.41726: Flags [P.],
cksum 0x5df7 (incorrect -> 0x93b9), seq 49:91, ack 1, win 510, options [nop,nop,TS val 792557032 ecr 430181741],
length 42
0x0000: 4500 005e 61e4 4000 4006 7b0f ac10 025f E..^a.@.@.{...._
0x0010: ac10 0327 0ceb a2fe c48c 6755 bf6c 4c56 ...'......gU.lLV
0x0020: 8018 01fe 5df7 0000 0101 080a 2f3d 75e8 ....]......./=u.
0x0030: 19a4 0d6d 4931 3d64 6131 6262 3030 3035 ...mI1=da1bb0005
0x0040: 6339 6331 3165 3939 6565 3730 3031 3633 c9c11e99ee700163
0x0050: 6566 6162 6163 303a 3535 3330 300a efabac0:55300.
mysql> SHOW GLOBAL VARIABLES LIKE 'gtid_executed';
+---------------+----------------------------------------------+
| Variable_name | Value |
+---------------+----------------------------------------------+
| gtid_executed | da1bb000-5c9c-11e9-9ee7-00163efabac0:1-55300 |
+---------------+----------------------------------------------+
1 row in set (0.00 sec)
© 2019 Percona53
ProxySQL 2.0 - GTID Leituras Consistentes
01:30:44.388537 IP (tos 0x0, ttl 64, id 25061, offset 0, flags [DF], proto TCP (6), length 61)
marcelo-altmann-PU-replication-1.lxd.opsession-prxy > marcelo-altmann-PU-proxysql-1.lxd.41726: Flags [P.],
cksum 0x5dd6 (incorrect -> 0xa8c8), seq 91:100, ack 1, win 510, options [nop,nop,TS val 792575354 ecr
430213726], length 9
0x0000: 4500 003d 61e5 4000 4006 7b2f ac10 025f E..=a.@.@.{/..._
0x0010: ac10 0327 0ceb a2fe c48c 677f bf6c 4c56 ...'......g..lLV
0x0020: 8018 01fe 5dd6 0000 0101 080a 2f3d bd7a ....]......./=.z
0x0030: 19a4 8a5e 4932 3d35 3533 3031 0a ...^I2=55301.
mysql> SHOW GLOBAL VARIABLES LIKE 'gtid_executed';
+---------------+----------------------------------------------+
| Variable_name | Value |
+---------------+----------------------------------------------+
| gtid_executed | da1bb000-5c9c-11e9-9ee7-00163efabac0:1-55301 |
+---------------+----------------------------------------------+
1 row in set (0.00 sec)
© 2019 Percona54
Caso de uso
© 2019 Percona55
ProxySQL - Caso de uso
▪Wordpress - 20 clientes conectados / 5K requests
▪Teste 1 - Conectando somente em 1 servidor
▪Teste 2 - Distribuindo carga entre 3 servidores
▪Teste 3 - Realizando cache das top 20 queries
© 2019 Percona56
ProxySQL - Caso de uso
© 2019 Percona57
ProxySQL - Caso de uso
© 2019 Percona58
Perguntas?
DATABASE PERFORMANCE
MATTERS
Database Performance MattersDatabase Performance MattersDatabase Performance MattersDatabase Performance MattersDatabase Performance Matters
Obrigado!

More Related Content

What's hot

Percona Xtrabackup Best Practices
Percona Xtrabackup Best PracticesPercona Xtrabackup Best Practices
Percona Xtrabackup Best Practices
Marcelo Altmann
 
Maxscale switchover, failover, and auto rejoin
Maxscale switchover, failover, and auto rejoinMaxscale switchover, failover, and auto rejoin
Maxscale switchover, failover, and auto rejoin
Wagner Bianchi
 
Zabbix, garder un oeil toujours ouvert
Zabbix, garder un oeil toujours ouvertZabbix, garder un oeil toujours ouvert
Zabbix, garder un oeil toujours ouvert
Look a box
 
Using The Mysql Binary Log As A Change Stream
Using The Mysql Binary Log As A Change StreamUsing The Mysql Binary Log As A Change Stream
Using The Mysql Binary Log As A Change Stream
Luís Soares
 
Kubernetes Controller for Pull Request Based Environment
Kubernetes Controller for Pull Request Based EnvironmentKubernetes Controller for Pull Request Based Environment
Kubernetes Controller for Pull Request Based Environment
Vishal Banthia
 
News And Development Update Of The CloudStack Tungsten Fabric SDN Plug-in
News And Development Update Of The CloudStack Tungsten Fabric SDN Plug-inNews And Development Update Of The CloudStack Tungsten Fabric SDN Plug-in
News And Development Update Of The CloudStack Tungsten Fabric SDN Plug-in
ShapeBlue
 
Deploying MariaDB databases with containers at Nokia Networks
Deploying MariaDB databases with containers at Nokia NetworksDeploying MariaDB databases with containers at Nokia Networks
Deploying MariaDB databases with containers at Nokia Networks
MariaDB plc
 
My sql failover test using orchestrator
My sql failover test  using orchestratorMy sql failover test  using orchestrator
My sql failover test using orchestrator
YoungHeon (Roy) Kim
 
JVMのGCアルゴリズムとチューニング
JVMのGCアルゴリズムとチューニングJVMのGCアルゴリズムとチューニング
JVMのGCアルゴリズムとチューニング
佑哉 廣岡
 
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and OrchestratorAlmost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Jean-François Gagné
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18
Derek Downey
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
Jean-François Gagné
 
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best PracticesMySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
Kenny Gryp
 
Open stack概要とよくある議論
Open stack概要とよくある議論Open stack概要とよくある議論
Open stack概要とよくある議論
shintaro mizuno
 
PhNOG Report APRICOT 2023
PhNOG Report APRICOT 2023PhNOG Report APRICOT 2023
PhNOG Report APRICOT 2023
APNIC
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers
MariaDB plc
 
MySQL SYSスキーマのご紹介
MySQL SYSスキーマのご紹介MySQL SYSスキーマのご紹介
MySQL SYSスキーマのご紹介
Shinya Sugiyama
 
MariaDB MaxScale
MariaDB MaxScaleMariaDB MaxScale
MariaDB MaxScale
MariaDB plc
 
Linux/DB Tuning (DevSumi2010, Japanese)
Linux/DB Tuning (DevSumi2010, Japanese)Linux/DB Tuning (DevSumi2010, Japanese)
Linux/DB Tuning (DevSumi2010, Japanese)Yoshinori Matsunobu
 
MariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationMariaDB Galera Cluster presentation
MariaDB Galera Cluster presentation
Francisco Gonçalves
 

What's hot (20)

Percona Xtrabackup Best Practices
Percona Xtrabackup Best PracticesPercona Xtrabackup Best Practices
Percona Xtrabackup Best Practices
 
Maxscale switchover, failover, and auto rejoin
Maxscale switchover, failover, and auto rejoinMaxscale switchover, failover, and auto rejoin
Maxscale switchover, failover, and auto rejoin
 
Zabbix, garder un oeil toujours ouvert
Zabbix, garder un oeil toujours ouvertZabbix, garder un oeil toujours ouvert
Zabbix, garder un oeil toujours ouvert
 
Using The Mysql Binary Log As A Change Stream
Using The Mysql Binary Log As A Change StreamUsing The Mysql Binary Log As A Change Stream
Using The Mysql Binary Log As A Change Stream
 
Kubernetes Controller for Pull Request Based Environment
Kubernetes Controller for Pull Request Based EnvironmentKubernetes Controller for Pull Request Based Environment
Kubernetes Controller for Pull Request Based Environment
 
News And Development Update Of The CloudStack Tungsten Fabric SDN Plug-in
News And Development Update Of The CloudStack Tungsten Fabric SDN Plug-inNews And Development Update Of The CloudStack Tungsten Fabric SDN Plug-in
News And Development Update Of The CloudStack Tungsten Fabric SDN Plug-in
 
Deploying MariaDB databases with containers at Nokia Networks
Deploying MariaDB databases with containers at Nokia NetworksDeploying MariaDB databases with containers at Nokia Networks
Deploying MariaDB databases with containers at Nokia Networks
 
My sql failover test using orchestrator
My sql failover test  using orchestratorMy sql failover test  using orchestrator
My sql failover test using orchestrator
 
JVMのGCアルゴリズムとチューニング
JVMのGCアルゴリズムとチューニングJVMのGCアルゴリズムとチューニング
JVMのGCアルゴリズムとチューニング
 
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and OrchestratorAlmost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
 
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best PracticesMySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
 
Open stack概要とよくある議論
Open stack概要とよくある議論Open stack概要とよくある議論
Open stack概要とよくある議論
 
PhNOG Report APRICOT 2023
PhNOG Report APRICOT 2023PhNOG Report APRICOT 2023
PhNOG Report APRICOT 2023
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers
 
MySQL SYSスキーマのご紹介
MySQL SYSスキーマのご紹介MySQL SYSスキーマのご紹介
MySQL SYSスキーマのご紹介
 
MariaDB MaxScale
MariaDB MaxScaleMariaDB MaxScale
MariaDB MaxScale
 
Linux/DB Tuning (DevSumi2010, Japanese)
Linux/DB Tuning (DevSumi2010, Japanese)Linux/DB Tuning (DevSumi2010, Japanese)
Linux/DB Tuning (DevSumi2010, Japanese)
 
MariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationMariaDB Galera Cluster presentation
MariaDB Galera Cluster presentation
 

Similar to Percona University - ProxySQL para MySQL

DB Floripa - ProxySQL para MySQL
DB Floripa - ProxySQL para MySQLDB Floripa - ProxySQL para MySQL
DB Floripa - ProxySQL para MySQL
Marcelo Altmann
 
Guob - MySQL e LGPD
Guob - MySQL e LGPDGuob - MySQL e LGPD
Guob - MySQL e LGPD
Vinicius M Grippa
 
Proxy SQL 2.0 with PXC
Proxy SQL 2.0 with PXCProxy SQL 2.0 with PXC
Proxy SQL 2.0 with PXC
Vinicius M Grippa
 
ProxySQL para mysql
ProxySQL para mysqlProxySQL para mysql
ProxySQL para mysql
Marcelo Altmann
 
Curso de MySQL 5.7
Curso de MySQL 5.7Curso de MySQL 5.7
Curso de MySQL 5.7
Eduardo Legatti
 
Deploying Percona XtraDB Cluster in Openshift
Deploying Percona XtraDB Cluster in OpenshiftDeploying Percona XtraDB Cluster in Openshift
Deploying Percona XtraDB Cluster in Openshift
Alexander Rubin
 
My sql 5.6&MySQL Cluster 7.3
My sql 5.6&MySQL Cluster 7.3My sql 5.6&MySQL Cluster 7.3
My sql 5.6&MySQL Cluster 7.3
Oleksii(Alexey) Porytskyi
 
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...Geir Høydalsvik
 
ProxySQL & PXC(Query routing and Failover Test)
ProxySQL & PXC(Query routing and Failover Test)ProxySQL & PXC(Query routing and Failover Test)
ProxySQL & PXC(Query routing and Failover Test)
YoungHeon (Roy) Kim
 
How to upgrade like a boss to MySQL 8.0 - PLE19
How to upgrade like a boss to MySQL 8.0 -  PLE19How to upgrade like a boss to MySQL 8.0 -  PLE19
How to upgrade like a boss to MySQL 8.0 - PLE19
Alkin Tezuysal
 
Percona Live 2012PPT:mysql-security-privileges-and-user-management
Percona Live 2012PPT:mysql-security-privileges-and-user-managementPercona Live 2012PPT:mysql-security-privileges-and-user-management
Percona Live 2012PPT:mysql-security-privileges-and-user-management
mysqlops
 
ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022
René Cannaò
 
Percona Live 2019 - MySQL Security
Percona Live 2019 - MySQL SecurityPercona Live 2019 - MySQL Security
Percona Live 2019 - MySQL Security
Vinicius M Grippa
 
MySQL Security and Standardization at PayPal - Percona Live 2019
MySQL Security and Standardization at PayPal - Percona Live 2019MySQL Security and Standardization at PayPal - Percona Live 2019
MySQL Security and Standardization at PayPal - Percona Live 2019
Yashada Jadhav
 
How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?
Alkin Tezuysal
 
Introduction to Vitess on Kubernetes for MySQL - Webinar
Introduction to Vitess on Kubernetes for MySQL -  WebinarIntroduction to Vitess on Kubernetes for MySQL -  Webinar
Introduction to Vitess on Kubernetes for MySQL - Webinar
Alkin Tezuysal
 
OpenSUSE Conf 2020 MySQL Clone
OpenSUSE Conf 2020 MySQL CloneOpenSUSE Conf 2020 MySQL Clone
OpenSUSE Conf 2020 MySQL Clone
Georgi Kodinov
 
MySQL sys schema deep dive
MySQL sys schema deep diveMySQL sys schema deep dive
MySQL sys schema deep dive
Mark Leith
 
Using Vault to decouple MySQL Secrets
Using Vault to decouple MySQL SecretsUsing Vault to decouple MySQL Secrets
Using Vault to decouple MySQL Secrets
Derek Downey
 
NoSQL on MySQL - MySQL Document Store by Vadim Tkachenko
NoSQL on MySQL - MySQL Document Store by Vadim TkachenkoNoSQL on MySQL - MySQL Document Store by Vadim Tkachenko
NoSQL on MySQL - MySQL Document Store by Vadim Tkachenko
Data Con LA
 

Similar to Percona University - ProxySQL para MySQL (20)

DB Floripa - ProxySQL para MySQL
DB Floripa - ProxySQL para MySQLDB Floripa - ProxySQL para MySQL
DB Floripa - ProxySQL para MySQL
 
Guob - MySQL e LGPD
Guob - MySQL e LGPDGuob - MySQL e LGPD
Guob - MySQL e LGPD
 
Proxy SQL 2.0 with PXC
Proxy SQL 2.0 with PXCProxy SQL 2.0 with PXC
Proxy SQL 2.0 with PXC
 
ProxySQL para mysql
ProxySQL para mysqlProxySQL para mysql
ProxySQL para mysql
 
Curso de MySQL 5.7
Curso de MySQL 5.7Curso de MySQL 5.7
Curso de MySQL 5.7
 
Deploying Percona XtraDB Cluster in Openshift
Deploying Percona XtraDB Cluster in OpenshiftDeploying Percona XtraDB Cluster in Openshift
Deploying Percona XtraDB Cluster in Openshift
 
My sql 5.6&MySQL Cluster 7.3
My sql 5.6&MySQL Cluster 7.3My sql 5.6&MySQL Cluster 7.3
My sql 5.6&MySQL Cluster 7.3
 
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
 
ProxySQL & PXC(Query routing and Failover Test)
ProxySQL & PXC(Query routing and Failover Test)ProxySQL & PXC(Query routing and Failover Test)
ProxySQL & PXC(Query routing and Failover Test)
 
How to upgrade like a boss to MySQL 8.0 - PLE19
How to upgrade like a boss to MySQL 8.0 -  PLE19How to upgrade like a boss to MySQL 8.0 -  PLE19
How to upgrade like a boss to MySQL 8.0 - PLE19
 
Percona Live 2012PPT:mysql-security-privileges-and-user-management
Percona Live 2012PPT:mysql-security-privileges-and-user-managementPercona Live 2012PPT:mysql-security-privileges-and-user-management
Percona Live 2012PPT:mysql-security-privileges-and-user-management
 
ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022ProxySQL Cluster - Percona Live 2022
ProxySQL Cluster - Percona Live 2022
 
Percona Live 2019 - MySQL Security
Percona Live 2019 - MySQL SecurityPercona Live 2019 - MySQL Security
Percona Live 2019 - MySQL Security
 
MySQL Security and Standardization at PayPal - Percona Live 2019
MySQL Security and Standardization at PayPal - Percona Live 2019MySQL Security and Standardization at PayPal - Percona Live 2019
MySQL Security and Standardization at PayPal - Percona Live 2019
 
How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?
 
Introduction to Vitess on Kubernetes for MySQL - Webinar
Introduction to Vitess on Kubernetes for MySQL -  WebinarIntroduction to Vitess on Kubernetes for MySQL -  Webinar
Introduction to Vitess on Kubernetes for MySQL - Webinar
 
OpenSUSE Conf 2020 MySQL Clone
OpenSUSE Conf 2020 MySQL CloneOpenSUSE Conf 2020 MySQL Clone
OpenSUSE Conf 2020 MySQL Clone
 
MySQL sys schema deep dive
MySQL sys schema deep diveMySQL sys schema deep dive
MySQL sys schema deep dive
 
Using Vault to decouple MySQL Secrets
Using Vault to decouple MySQL SecretsUsing Vault to decouple MySQL Secrets
Using Vault to decouple MySQL Secrets
 
NoSQL on MySQL - MySQL Document Store by Vadim Tkachenko
NoSQL on MySQL - MySQL Document Store by Vadim TkachenkoNoSQL on MySQL - MySQL Document Store by Vadim Tkachenko
NoSQL on MySQL - MySQL Document Store by Vadim Tkachenko
 

More from Marcelo Altmann

Backup Online no MySQL com Percona Xtrabackup
Backup Online no MySQL com Percona XtrabackupBackup Online no MySQL com Percona Xtrabackup
Backup Online no MySQL com Percona Xtrabackup
Marcelo Altmann
 
Percona XtraBackup - New Features and Improvements
Percona XtraBackup - New Features and ImprovementsPercona XtraBackup - New Features and Improvements
Percona XtraBackup - New Features and Improvements
Marcelo Altmann
 
Troubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer PerspectiveTroubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer Perspective
Marcelo Altmann
 
Backup para MySQL
Backup para MySQLBackup para MySQL
Backup para MySQL
Marcelo Altmann
 
GDB e Análise de Bugs
GDB e Análise de BugsGDB e Análise de Bugs
GDB e Análise de Bugs
Marcelo Altmann
 
MySQL Backup Best Practices and Case Study- .ie Continuous Restore Process
MySQL Backup Best Practices and Case Study- .ie Continuous Restore ProcessMySQL Backup Best Practices and Case Study- .ie Continuous Restore Process
MySQL Backup Best Practices and Case Study- .ie Continuous Restore Process
Marcelo Altmann
 
A Percona Support Engineer Walkthrough on pt-stalk
A Percona Support Engineer Walkthrough on pt-stalkA Percona Support Engineer Walkthrough on pt-stalk
A Percona Support Engineer Walkthrough on pt-stalk
Marcelo Altmann
 
MysQL melhores práticas de seguranca
MysQL  melhores práticas de segurancaMysQL  melhores práticas de seguranca
MysQL melhores práticas de seguranca
Marcelo Altmann
 
Optimizando MySQL
Optimizando MySQLOptimizando MySQL
Optimizando MySQL
Marcelo Altmann
 
MySQL - Melhores práticas de replicação de dados
MySQL - Melhores práticas de replicação de dadosMySQL - Melhores práticas de replicação de dados
MySQL - Melhores práticas de replicação de dados
Marcelo Altmann
 
Percona Live London 2014 - MySQL Backup Strategy @ IEDR
Percona Live London 2014 - MySQL Backup Strategy @ IEDRPercona Live London 2014 - MySQL Backup Strategy @ IEDR
Percona Live London 2014 - MySQL Backup Strategy @ IEDR
Marcelo Altmann
 

More from Marcelo Altmann (11)

Backup Online no MySQL com Percona Xtrabackup
Backup Online no MySQL com Percona XtrabackupBackup Online no MySQL com Percona Xtrabackup
Backup Online no MySQL com Percona Xtrabackup
 
Percona XtraBackup - New Features and Improvements
Percona XtraBackup - New Features and ImprovementsPercona XtraBackup - New Features and Improvements
Percona XtraBackup - New Features and Improvements
 
Troubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer PerspectiveTroubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer Perspective
 
Backup para MySQL
Backup para MySQLBackup para MySQL
Backup para MySQL
 
GDB e Análise de Bugs
GDB e Análise de BugsGDB e Análise de Bugs
GDB e Análise de Bugs
 
MySQL Backup Best Practices and Case Study- .ie Continuous Restore Process
MySQL Backup Best Practices and Case Study- .ie Continuous Restore ProcessMySQL Backup Best Practices and Case Study- .ie Continuous Restore Process
MySQL Backup Best Practices and Case Study- .ie Continuous Restore Process
 
A Percona Support Engineer Walkthrough on pt-stalk
A Percona Support Engineer Walkthrough on pt-stalkA Percona Support Engineer Walkthrough on pt-stalk
A Percona Support Engineer Walkthrough on pt-stalk
 
MysQL melhores práticas de seguranca
MysQL  melhores práticas de segurancaMysQL  melhores práticas de seguranca
MysQL melhores práticas de seguranca
 
Optimizando MySQL
Optimizando MySQLOptimizando MySQL
Optimizando MySQL
 
MySQL - Melhores práticas de replicação de dados
MySQL - Melhores práticas de replicação de dadosMySQL - Melhores práticas de replicação de dados
MySQL - Melhores práticas de replicação de dados
 
Percona Live London 2014 - MySQL Backup Strategy @ IEDR
Percona Live London 2014 - MySQL Backup Strategy @ IEDRPercona Live London 2014 - MySQL Backup Strategy @ IEDR
Percona Live London 2014 - MySQL Backup Strategy @ IEDR
 

Recently uploaded

【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
NABLAS株式会社
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
Subhajit Sahu
 
Opendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptxOpendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptx
Opendatabay
 
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
ewymefz
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
ewymefz
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
axoqas
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
ewymefz
 
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
ahzuo
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
jerlynmaetalle
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
haila53
 
Q1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year ReboundQ1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year Rebound
Oppotus
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
balafet
 
一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单
ewymefz
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
nscud
 
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
AbhimanyuSinha9
 
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
vcaxypu
 
Empowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptxEmpowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptx
benishzehra469
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
ewymefz
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
ahzuo
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP
 

Recently uploaded (20)

【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
 
Opendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptxOpendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptx
 
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
 
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
 
Q1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year ReboundQ1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year Rebound
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
 
一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
 
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
 
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
 
Empowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptxEmpowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptx
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
 

Percona University - ProxySQL para MySQL

  • 1. © 2019 Percona1 Marcelo Altmann ProxySQL para MySQL Mais que um simples proxy - Exemplos de uso Senior Support Engineer Percona University - São Paulo 27/04/2019
  • 3. © 2019 Percona3 Agenda ▪Sobre Mim ▪Introdução ▪Features ▪Caso de uso
  • 5. © 2019 Percona5 Marcelo Altmann ▪Engenheiro de Suporte @ percona • MySQL DBA @ IEDR (CCTLD Irlanda) ▪Tecnologo em Sistemas para Internet ▪Oracle ACE Associate ▪blog.marceloaltmann.com ▪Certificaçoes • OCP, MySQL 5.7 Database Administrator • OCP, MySQL 5.6 Database Administrator • OCP, MySQL 5.6 Developer • OCP, MySQL 5 Database Administrator • OCP, MySQL 5 Developer • OCP, MySQL 5.0/5.1/5.5
  • 6. © 2019 Percona6 ProxySQL - Introdução
  • 7. © 2019 Percona7 ProxySQL - Introdução ▪Criado e mantido por René Cannaò • MySQL Community - Contribuidor do ano (2017) • MySQL Community - Software do ano (2018) • MySQL Community Contributor Award - Oracle (2019) ▪Open Source • http://www.proxysql.com/ • https://github.com/sysown/proxysql
  • 8. © 2019 Percona8 ProxySQL - Introdução ▪Instalação • Source Code / rpm / deb / percona repo (yum / apt-get) ▪MySQL admin interface [root@localhost ~]# mysql -u admin -padmin -P 6032 -h 127.0.0.1 --prompt='Admin> ' mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 1 Server version: 5.5.30 (ProxySQL Admin Module) . . . Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. Admin>
  • 9. © 2019 Percona9 ProxySQL - Introdução ▪Camadas • Runtime - Dados que o proxySQL acessa • Main/Memory - Camada onde executamos alterações e monitoramento • Disk - Camada para persistir dados. SQLite3
  • 10. © 2019 Percona10 ProxySQL - Introdução +-------------------------+ | 1. RUNTIME | <- processo proxysql +-------------------------+ /| | | | | |/ +-------------------------+ | 2. MEMORY | <- DML +-------------------------+ /| | | | | |/ +-------------------------+ | 3. DISK | <- /var/lib/proxysql/proxysql.db +-------------------------+
  • 11. © 2019 Percona11 ProxySQL - Introdução ▪Tabelas • mysql_servers - Contém a lista de servidores e HG (Host Group) mysql> SELECT hostgroup_id, hostname, status, comment FROM mysql_servers; +--------------+----------+--------+---------+ | hostgroup_id | hostname | status | comment | +--------------+----------+--------+---------+ | 10 | node1 | ONLINE | WRITE | | 11 | node2 | ONLINE | READ | | 11 | node3 | ONLINE | READ | +--------------+----------+--------+---------+
  • 12. © 2019 Percona12 ProxySQL - Introdução ▪Tabelas • mysql_users - Contém a lista de usuário para autenticação. mysql> SELECT username, default_hostgroup FROM mysql_users; +---------------+-------------------+ | username | default_hostgroup | +---------------+-------------------+ | proxysql_user | 10 | +---------------+-------------------+ 1 row in set (0.00 sec)
  • 13. © 2019 Percona13 ProxySQL - Introdução ▪Tabelas • mysql_query_rules - Contém a lista de regras para cache, reescrita e redirecionamento de queries.
  • 14. © 2019 Percona14 ProxySQL - Features - Load Balance
  • 15. © 2019 Percona15 ProxySQL - Features - Load Balance ▪Usuários de autenticação Admin> INSERT INTO mysql_users (username,password,default_hostgroup) VALUES ('proxysql_user','Pr0xySQL!',10); Query OK, 1 row affected (0.00 sec) Admin> LOAD MYSQL USERS TO RUNTIME ; Query OK, 0 rows affected (0.00 sec) Admin> SAVE MYSQL USERS FROM RUNTIME; -- Hack para o plain-text password Query OK, 0 rows affected (0.00 sec) Admin> SAVE MYSQL USERS TO DISK ; Query OK, 0 rows affected (0.01 sec)
  • 16. © 2019 Percona16 ProxySQL - Features - Load Balance ▪Redirecionamento do tráfego para lista de servidores Admin> INSERT INTO mysql_servers (hostname, hostgroup_id, comment) VALUES ('node1',10,'WRITE'),('node2',11,'READ'),('node3',11,'READ'); Query OK, 3 rows affected (0.00 sec) Admin> LOAD MYSQL SERVERS TO RUNTIME; Query OK, 0 rows affected (0.01 sec) Admin> SAVE MYSQL SERVERS TO DISK; Query OK, 0 rows affected (0.02 sec) Admin> SELECT hostgroup_id, hostname, status, comment FROM mysql_servers; +--------------+----------+--------+---------+ | hostgroup_id | hostname | status | comment | +--------------+----------+--------+---------+ | 10 | node1 | ONLINE | WRITE | | 11 | node2 | ONLINE | READ | | 11 | node3 | ONLINE | READ | +--------------+----------+--------+---------+ 3 rows in set (0.00 sec)
  • 17. © 2019 Percona17 ProxySQL - Features - Load Balance ▪Dividir leituras e escritas Admin> INSERT INTO mysql_query_rules (username,destination_hostgroup,active,match_digest,apply) -> VALUES -> ('proxysql_user',10,1,'^SELECT.*FOR UPDATE',1), -> ('proxysql_user',11,1,'^SELECT ',1); Query OK, 2 rows affected (0.00 sec) Admin> LOAD MYSQL QUERY RULES TO RUNTIME; SAVE MYSQL QUERY RULES TO DISK; Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.01 sec)
  • 18. © 2019 Percona18 ProxySQL - Features - Load Balance ▪Dividir leituras e escritas [root@localhost ~]# mysql -u proxysql_user -p'Pr0xySQL!' -P 6033 -h 127.0.0.1 -e "INSERT INTO test.t1 VALUES (@@hostname)" [root@localhost ~]# mysql -u proxysql_user -p'Pr0xySQL!' -P 6033 -h 127.0.0.1 -e "SELECT @@hostname, server FROM test.t1" +------------+--------+ | @@hostname | server | +------------+--------+ | node2 | node1 | +------------+--------+ [root@localhost ~]# mysql -u proxysql_user -p'Pr0xySQL!' -P 6033 -h 127.0.0.1 -e "SELECT @@hostname, server FROM test.t1" +------------+--------+ | @@hostname | server | +------------+--------+ | node3 | node1 | +------------+--------+
  • 19. © 2019 Percona19 ProxySQL - Features - Failover
  • 20. © 2019 Percona20 ProxySQL - Features - Failover ▪Replicação • Mysql_replication_hostgroups - Validar a variável read_only no MySQL Admin> INSERT INTO mysql_replication_hostgroups (writer_hostgroup, reader_hostgroup) VALUES (10, 11); Admin> LOAD MYSQL SERVERS TO RUNTIME; SAVE MYSQL SERVERS TO DISK;
  • 21. © 2019 Percona21 ProxySQL - Features - Failover ▪Percona XtraDB Cluster / Galera • Scheduler - Script que roda a cada X milisegundos ▪https://github.com/percona/proxysql-admin-tool ▪Modos • Single Write • Load Balance
  • 22. © 2019 Percona22 ProxySQL - Features - Failover ▪Mysql_galera_hostgroups (proxysql 2.0) • Writer_hostgroup • Backup_writer_hostgroup • Reader_hostgroup • Offline_hostgroup
  • 23. © 2019 Percona23 ProxySQL - Features - Connection Pool
  • 24. © 2019 Percona24 ProxySQL - Features - Connection Pool
  • 25. © 2019 Percona25 ProxySQL - Features - Connection Pool
  • 26. © 2019 Percona26 ProxySQL - Features - Connection Pool
  • 27. © 2019 Percona27 ProxySQL - Features - Connection Pool
  • 28. © 2019 Percona28 ProxySQL - Features - Multiplexing
  • 29. © 2019 Percona29 ProxySQL - Features - Multiplexing
  • 30. © 2019 Percona30 ProxySQL - Features - Multiplexing
  • 31. © 2019 Percona31 ProxySQL - Features - Multiplexing
  • 32. © 2019 Percona32 ProxySQL - Features - Stats
  • 33. © 2019 Percona33 ProxySQL - Features - Stats ▪SHOW TABLES FROM stats; • Stats_mysql_commands_counters - Contador baseado em comandos • Stats_mysql_connection_pool - Conexoes por servidor • Stats_mysql_global - Estatisticas globais • Stats_mysql_processlist - SHOW PROCESSLIST • Stats_mysql_query_digest - Contador agrupado por digest • Stats_mysql_query_rules - Contador baseado nas query rules
  • 34. © 2019 Percona34 ProxySQL - Features - Reescrita de Query
  • 35. © 2019 Percona35 ProxySQL - Features - Reescrita de query ▪stats_mysql_query_digest Admin> SELECT digest, digest_text, sum_time FROM stats_mysql_query_digest ORDER BY sum_time DESC LIMIT 1; +--------------------+-----------------------------------------+----------+ | digest | digest_text | sum_time | +--------------------+-----------------------------------------+----------+ | 0xD69E622A5052289E | SELECT * FROM world.city WHERE Name = ? | 7016461 | +--------------------+-----------------------------------------+----------+ Admin> INSERT INTO mysql_query_rules (rule_id,active,match_pattern, replace_pattern) VALUES (3,1, '^SELECT * FROM world.city WHERE Name = (.*)$', 'SELECT Population FROM world.city WHERE Name = 1'); Query OK, 1 row affected (0.00 sec) Admin> LOAD MYSQL QUERY RULES TO RUNTIME; Query OK, 0 rows affected (0.01 sec) Admin> SAVE MYSQL QUERY RULES TO DISK; Query OK, 0 rows affected (0.01 sec)
  • 36. © 2019 Percona36 ProxySQL - Features - Reescrita de query [root@localhost ~]# mysql -u proxysql_user -p'Pr0xySQL!' -P 6033 -h 127.0.0.1 -e "SELECT * FROM world.city WHERE Name = 'São Paulo'" +------------+ | Population | +------------+ | 9968485 | +------------+
  • 37. © 2019 Percona37 ProxySQL - Features - Firewall
  • 38. © 2019 Percona38 ProxySQL - Features - Firewall ▪Bloquear queries - SQL INJECTION! • Original query: SELECT Name FROM world.city WHERE Name = ‘?’ • SQL Injection: ? = São Paulo' OR ID > 0; -- • SELECT Name FROM world.city WHERE Name = 'São Paulo' OR ID > 0; --' Admin> SELECT username, digest, digest_text FROM stats_mysql_query_digest WHERE digest_text LIKE '% OR ID %' ORDER BY first_seen DESC LIMIT 1; +-------------+--------------------+------------------------------------------------------+ | username | digest | digest_text | +-------------+--------------------+------------------------------------------------------+ | application | 0xD8AF41BF32707ABD | SELECT Name FROM world.city WHERE Name = ? OR ID > ? | +-------------+--------------------+------------------------------------------------------+ 1 row in set (0.00 sec)
  • 39. © 2019 Percona39 ProxySQL - Features - Firewall Admin> INSERT INTO mysql_query_rules (rule_id, active, digest, error_msg, apply) VALUES (4,1,'0xD8AF41BF32707ABD','Suspeita de SQL Injection',1); Query OK, 1 row affected (0.00 sec) Admin> LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK; Query OK, 0 rows affected (0.01 sec) Query OK, 0 rows affected (0.01 sec) [root@localhost ~]# mysql -u application -papp -P 6033 -h 127.0.0.1 -e "SELECT Name FROM world.city WHERE Name = 'São Paulo' OR ID > 0; --' " ERROR 1148 (42000) at line 1: Suspeita de SQL Injection
  • 40. © 2019 Percona40 ProxySQL - Features - Espelhamento de Query
  • 41. © 2019 Percona41 ProxySQL - Features - Mirror ▪Espelhar queries em outros servidores • Testar configurações • Standby Master - Manter buffer pool quente • Testar workload em versões diferentes - Upgrades • Troubleshooting
  • 42. © 2019 Percona42 ProxySQL - Features - Mirror ▪Esquentar buffer pool Admin> INSERT INTO mysql_servers (hostgroup_id, hostname) VALUES (12, 'node4'); Admin> LOAD MYSQL SERVERS TO RUNTIME; SAVE MYSQL SERVERS TO DISK; Admin> SELECT rule_id, match_digest, destination_hostgroup, mirror_hostgroup FROM mysql_query_rules WHERE rule_id=2; +---------+--------------+-----------------------+------------------+ | rule_id | match_digest | destination_hostgroup | mirror_hostgroup | +---------+--------------+-----------------------+------------------+ | 2 | ^SELECT | 11 | NULL | +---------+--------------+-----------------------+------------------+ Admin> UPDATE mysql_query_rules SET mirror_hostgroup=12 WHERE rule_id=2; Admin> LOAD MYSQL QUERY RULES TO RUNTIME; Admin> SAVE MYSQL QUERY RULES TO DISK;
  • 43. © 2019 Percona43 ProxySQL - Features - Query Cache
  • 44. © 2019 Percona44 ProxySQL - Features - Query Cache ▪Cache de queries baseado em TTL [root@localhost ~]# sysbench --num-threads=16 --max-requests=0 --max-time=60 --test=/usr/share/doc/sysbench/tests/db/oltp.lua --mysql-user=application --mysql-password=app --mysql-db=test --mysql-host=127.0.0.1 --mysql-port=6033 --oltp-table-size=10000 --oltp-read-only=on --oltp-skip-trx=on --oltp-point-selects=100 --oltp-simple-ranges=1 --oltp-sum-ranges=1 --oltp-order-ranges=1 --oltp-distinct-ranges=1 run | grep 'read/write requests' read/write requests: 105664 (1744.81 per sec.) Admin> SELECT count_star,sum_time,hostgroup,digest,digest_text FROM stats_mysql_query_digest ORDER BY sum_time DESC; +--------------+-----------+-----------+--------------------+-----------------------------------------------------------------------+ | count_star | sum_time | hostgroup | digest | digest_text | +--------------+-----------+-----------+--------------------+-----------------------------------------------------------------------+ | 100200 | 459147213 | 11 | 0xBF001A0C13781C1D | SELECT c FROM sbtest1 WHERE id=? | | 1002 | 6533622 | 11 | 0xF7D3CD60704822A0 | SELECT DISTINCT c FROM sbtest1 WHERE id BETWEEN ? AND ?+? ORDER BY c | | 1002 | 6061540 | 11 | 0x877EEAAFADF3DDF2 | SELECT c FROM sbtest1 WHERE id BETWEEN ? AND ?+? ORDER BY c | | 1002 | 5905677 | 11 | 0xAF7A51977DD56217 | SELECT c FROM sbtest1 WHERE id BETWEEN ? AND ?+? | | 1002 | 5321376 | 11 | 0x3E268CF3E75DB831 | SELECT SUM(K) FROM sbtest1 WHERE id BETWEEN ? AND ?+? | +--------------+-----------+-----------+--------------------+-----------------------------------------------------------------------+
  • 45. © 2019 Percona45 ProxySQL - Features - Query Cache Admin> INSERT INTO mysql_query_rules (rule_id,active,digest,cache_ttl,apply) VALUES (5,1, '0xBF001A0C13781C1D' ,2000,1); Query OK, 1 row affected (0.00 sec) Admin> LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK; [root@localhost ~]# sysbench --num-threads=16 --max-requests=0 --max-time=60 --test=/usr/share/doc/sysbench/tests/db/oltp.lua --mysql-user=application --mysql-password=app --mysql-db=test --mysql-host=127.0.0.1 --mysql-port=6033 --oltp-table-size=10000 --oltp-read-only=on --oltp-skip-trx=on --oltp-point-selects=100 --oltp-simple-ranges=1 --oltp-sum-ranges=1 --oltp-order-ranges=1 --oltp-distinct-ranges=1 run | grep 'read/write requests' read/write requests: 238680 (3956.42 per sec.) Admin> SELECT count_star,sum_time,hostgroup,digest,digest_text FROM stats_mysql_query_digest ORDER BY sum_time DESC; +------------+-----------+-----------+--------------------+----------------------------------------------------------------------+ | count_star | sum_time | hostgroup | digest | digest_text | +------------+-----------+-----------+--------------------+----------------------------------------------------------------------+ | 140512 | 632180517 | 11 | 0xBF001A0C13781C1D | SELECT c FROM sbtest1 WHERE id=? | | 3372 | 18351846 | 11 | 0xF7D3CD60704822A0 | SELECT DISTINCT c FROM sbtest1 WHERE id BETWEEN ? AND ?+? ORDER BY c | | 3372 | 17739689 | 11 | 0x877EEAAFADF3DDF2 | SELECT c FROM sbtest1 WHERE id BETWEEN ? AND ?+? ORDER BY c | | 3372 | 17709660 | 11 | 0xAF7A51977DD56217 | SELECT c FROM sbtest1 WHERE id BETWEEN ? AND ?+? | | 3372 | 15646777 | 11 | 0x3E268CF3E75DB831 | SELECT SUM(K) FROM sbtest1 WHERE id BETWEEN ? AND ?+? | | 196688 | 0 | -1 | 0xBF001A0C13781C1D | SELECT c FROM sbtest1 WHERE id=? | +------------+-----------+-----------+--------------------+----------------------------------------------------------------------+
  • 46. © 2019 Percona46 ProxySQL - Features - GTID Leituras Consistentes
  • 47. © 2019 Percona47 ProxySQL 2.0 - GTID Leituras Consistentes ▪Stale reads ▪Requer modificações na aplicação • WAIT_FOR_EXECUTED_GTID_SET • Verificar multiplos slaves • Nenhum slave em sync
  • 48. © 2019 Percona48 ProxySQL 2.0 - GTID Leituras Consistentes ▪MySQL 5.7.5+ - session_track_gtids ▪Verificar GTID no slave? • Pull - Verificar slaves em intervalos • Push - Slaves notificam o ProxySQL
  • 49. © 2019 Percona49 ProxySQL 2.0 - GTID Leituras Consistentes ▪ProxySQL Binlog Reader • https://github.com/sysown/proxysql_mysqlbinlog
  • 50. © 2019 Percona50 ProxySQL 2.0 - GTID Leituras Consistentes
  • 51. © 2019 Percona51 ProxySQL 2.0 - GTID Leituras Consistentes 01:29:54.081552 IP (tos 0x0, ttl 64, id 25059, offset 0, flags [DF], proto TCP (6), length 100) marcelo-altmann-PU-replication-1.lxd.opsession-prxy > marcelo-altmann-PU-proxysql-1.lxd.41726: Flags [P.], cksum 0x5dfd (incorrect -> 0xc8cb), seq 1:49, ack 1, win 510, options [nop,nop,TS val 792525047 ecr 430181741],length 48 0x0000: 4500 0064 61e3 4000 4006 7b0a ac10 025f E..da.@.@.{...._ 0x0010: ac10 0327 0ceb a2fe c48c 6725 bf6c 4c56 ...'......g%.lLV 0x0020: 8018 01fe 5dfd 0000 0101 080a 2f3c f8f7 ....]......./<.. 0x0030: 19a4 0d6d 5354 3d64 6131 6262 3030 302d ...mST=da1bb000- 0x0040: 3563 3963 2d31 3165 392d 3965 6537 2d30 5c9c-11e9-9ee7-0 0x0050: 3031 3633 6566 6162 6163 303a 312d 3535 0163efabac0:1-55 0x0060: 3239 390a 299. mysql> SHOW GLOBAL VARIABLES LIKE 'gtid_executed'; +---------------+----------------------------------------------+ | Variable_name | Value | +---------------+----------------------------------------------+ | gtid_executed | da1bb000-5c9c-11e9-9ee7-00163efabac0:1-55299 | +---------------+----------------------------------------------+ 1 row in set (0.00 sec)
  • 52. © 2019 Percona52 ProxySQL 2.0 - GTID Leituras Consistentes 01:30:26.066393 IP (tos 0x0, ttl 64, id 25060, offset 0, flags [DF], proto TCP (6), length 94) marcelo-altmann-PU-replication-1.lxd.opsession-prxy > marcelo-altmann-PU-proxysql-1.lxd.41726: Flags [P.], cksum 0x5df7 (incorrect -> 0x93b9), seq 49:91, ack 1, win 510, options [nop,nop,TS val 792557032 ecr 430181741], length 42 0x0000: 4500 005e 61e4 4000 4006 7b0f ac10 025f E..^a.@.@.{...._ 0x0010: ac10 0327 0ceb a2fe c48c 6755 bf6c 4c56 ...'......gU.lLV 0x0020: 8018 01fe 5df7 0000 0101 080a 2f3d 75e8 ....]......./=u. 0x0030: 19a4 0d6d 4931 3d64 6131 6262 3030 3035 ...mI1=da1bb0005 0x0040: 6339 6331 3165 3939 6565 3730 3031 3633 c9c11e99ee700163 0x0050: 6566 6162 6163 303a 3535 3330 300a efabac0:55300. mysql> SHOW GLOBAL VARIABLES LIKE 'gtid_executed'; +---------------+----------------------------------------------+ | Variable_name | Value | +---------------+----------------------------------------------+ | gtid_executed | da1bb000-5c9c-11e9-9ee7-00163efabac0:1-55300 | +---------------+----------------------------------------------+ 1 row in set (0.00 sec)
  • 53. © 2019 Percona53 ProxySQL 2.0 - GTID Leituras Consistentes 01:30:44.388537 IP (tos 0x0, ttl 64, id 25061, offset 0, flags [DF], proto TCP (6), length 61) marcelo-altmann-PU-replication-1.lxd.opsession-prxy > marcelo-altmann-PU-proxysql-1.lxd.41726: Flags [P.], cksum 0x5dd6 (incorrect -> 0xa8c8), seq 91:100, ack 1, win 510, options [nop,nop,TS val 792575354 ecr 430213726], length 9 0x0000: 4500 003d 61e5 4000 4006 7b2f ac10 025f E..=a.@.@.{/..._ 0x0010: ac10 0327 0ceb a2fe c48c 677f bf6c 4c56 ...'......g..lLV 0x0020: 8018 01fe 5dd6 0000 0101 080a 2f3d bd7a ....]......./=.z 0x0030: 19a4 8a5e 4932 3d35 3533 3031 0a ...^I2=55301. mysql> SHOW GLOBAL VARIABLES LIKE 'gtid_executed'; +---------------+----------------------------------------------+ | Variable_name | Value | +---------------+----------------------------------------------+ | gtid_executed | da1bb000-5c9c-11e9-9ee7-00163efabac0:1-55301 | +---------------+----------------------------------------------+ 1 row in set (0.00 sec)
  • 55. © 2019 Percona55 ProxySQL - Caso de uso ▪Wordpress - 20 clientes conectados / 5K requests ▪Teste 1 - Conectando somente em 1 servidor ▪Teste 2 - Distribuindo carga entre 3 servidores ▪Teste 3 - Realizando cache das top 20 queries
  • 56. © 2019 Percona56 ProxySQL - Caso de uso
  • 57. © 2019 Percona57 ProxySQL - Caso de uso
  • 59. DATABASE PERFORMANCE MATTERS Database Performance MattersDatabase Performance MattersDatabase Performance MattersDatabase Performance MattersDatabase Performance Matters Obrigado!