# Balancing proxysql rules

**URL:** https://forums.percona.com/t/balancing-proxysql-rules/32931
**Category:** Other MySQL® Questions
**Created:** [September 5, 2024, 9:14am UTC](https://forums.percona.com/t/balancing-proxysql-rules/32931 "2024-09-05T09:14:12Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Kim\_Van\_Holderbeke](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/kim_van_holderbeke/32/17642_2.png) [@Kim\_Van\_Holderbeke](https://forums.percona.com/u/Kim_Van_Holderbeke)
#### Post date: [September 5, 2024, 9:14am UTC](https://forums.percona.com/t/balancing-proxysql-rules/32931/1 "2024-09-05T09:14:12Z")

</div>

Hello,

I’m using proxysql version 2.4.8-2-g2cc900a.

I’m using following setup

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/3X/4/d/4d9f45d9fba3703716f6727c0a8a6db92388ce82.png)

I did this to create a rule for a specific user that need always to run on the secondary database that is sstdba21.

The rule is

![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/3X/7/4/742004156acba3cecbe98826d2d7080e6d42f93c.png)

I’m wondering there is a way to define that this rule need to run to hostgroup 1 when server in hostgroup 3 isn’t available.

kind regards  
Kim

---

<div class="post-metadata">

### Author: ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)
#### Post date: [September 5, 2024, 8:22pm UTC](https://forums.percona.com/t/balancing-proxysql-rules/32931/2 "2024-09-05T20:22:20Z")

</div>

hostgroup 3 should always be available. You should fix mysql\_servers so that all your potential hosts that receive reads are in there. Use ‘weight’ to focus traffic to your reader. server3 weight 1000, server2 weight 1000, server1 weight 1. That will split reads 50/50-ish between servers 3 & 2, and might send 0.01% of reads to server1, unless both 3 & 2 are down, then server1 gets it all.
