Lag based routing within a hostgroup

62 views
Skip to first unread message

Garrett Page

unread,
Mar 19, 2021, 12:41:17 PM3/19/21
to proxysql
Hi I'm very new to Proxysql and have been running some tests. I see that Proxysql will shun a server if the replication lag gets above a certain value, however is there a way to control the routing within a host group such that the server with the least lag gets the query?

For example I've been testing with two slaves. I have a single query rule with match pattern .* routing to hostgroup 1. Multiplexing is on. When I have the max_replication_lag set to the default of 20  and I turn the slave off Proxysql shuns the server as expected. If I create a delay on a slave that's under the 20 second threshold, Proxysql will still route queries to that slave even though the other slave has 0 lag and is therefor a better choice. Is there a way to control this so that it'll route the query to the slave with the least lag? 

Thanks in advance

Garrett Page

unread,
Mar 30, 2021, 12:24:58 PM3/30/21
to proxysql
I was able to setup something somewhat hacky by configuring a scheduler to set the weights on servers within a hostgroup based on lag. But is this behavior not something that Proxysql does on it's own? 
Reply all
Reply to author
Forward
0 new messages