Hi @Slava_Sarzhan and team, Greetings, I had successfully deployed the pxc-operator and pxc-db with proxysql using helm in k8s. And did do the sysbench test using oltp_read_write.lua script observed that all the reads & writes went to only one writer.
ProxySQLAdmin> select hostgroup,ConnUsed, MaxConnUsed, Queries from stats_mysql_connection_pool;
±----------±---------±------------±--------+
| hostgroup | ConnUsed | MaxConnUsed | Queries |
±----------±---------±------------±--------+
| 11 | 0 | 7 | 109148 |
| 11 | 0 | 0 | 0 |
| 11 | 0 | 0 | 0 |
| 10 | 0 | 1 | 1 |
| 10 | 0 | 0 | 0 |
| 10 | 0 | 0 | 0 |
| 12 | 0 | 0 | 0 |
| 12 | 0 | 0 | 0 |
±----------±---------±------------±--------+
and then i tried re-route my top 2 queries to hostgroup 10 which is reader and tried to add query rules for that as below but could not see any get added.
ProxySQLAdmin> INSERT INTO mysql_query_rules (rule_id,active,username,match_digest,destination_hostgroup,apply) VALUES(13,1,‘mssandbox’,‘^SELECT c FROM sysbenchdb WHERE id=?$’,10,1);
Query OK, 1 row affected (0.00 sec)
ProxySQLAdmin> INSERT INTO mysql_query_rules (rule_id,active,username,match_digest,destination_hostgroup,apply) VALUES(14,1,‘mssandbox’,‘DISTINCT c FROM sysbenchdb’,10,1);
Query OK, 1 row affected (0.00 sec)
ProxySQLAdmin> LOAD MYSQL QUERY RULES TO RUNTIME;
ProxySQLAdmin> SELECT match_digest,destination_hostgroup FROM mysql_query_rules WHERE active=1 AND username=‘mssandbox’ ORDER BY rule_id;
Empty set (0.00 sec)
- Please help or suggest on how to divert the traffic to various and also how to add new query rules.
- i went through [K8SPXC-735] ProxySQL uses only one server for reads - Percona JIRA is it still ok to use percona xtradbcluster with proxysql in production based on that issue?
Thank you so much,
Ajay