# Seting up read balancing globaly

**URL:** https://forums.linbit.com/t/seting-up-read-balancing-globaly/274
**Category:** DRBD
**Created:** [August 28, 2024, 4:49pm UTC](https://forums.linbit.com/t/seting-up-read-balancing-globaly/274 "2024-08-28T16:49:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sviridoff](https://yyz1.discourse-cdn.com/flex003/user_avatar/forums.linbit.com/sviridoff/32/255_2.png) [@sviridoff](https://forums.linbit.com/u/sviridoff)
#### Post date: [August 28, 2024, 4:49pm UTC](https://forums.linbit.com/t/seting-up-read-balancing-globaly/274/1 "2024-08-28T16:49:31Z")

</div>

Hi everyone! Can someone explane me how to corectly set up read balancing globaly, for all my drbd devices? All existing and all I will create in future. In this article

> **[DRBD Read-Balancing](https://linbit.com/blog/drbd-read-balancing/)**
>
> DRBD’s read-balancing feature has been available since version 8.4.1. This feature enables DRBD® to balance read requests between the Primary and Secondary nodes. You configure read-balancing in the “disk” section of the configuration file(s). On the...

I read about configuration file - disk section. Is it mean /etc/drbd.d/global\_common.conf ? I can’t find this in commented part of disk section. And how I must corectly write this parameter? Maybe some example 😉

---

<div class="post-metadata">

### Author: ![kermat](https://yyz1.discourse-cdn.com/flex003/user_avatar/forums.linbit.com/kermat/32/21_2.png) [@kermat](https://forums.linbit.com/u/kermat)
#### Post date: [August 29, 2024, 12:45pm UTC](https://forums.linbit.com/t/seting-up-read-balancing-globaly/274/2 "2024-08-29T12:45:19Z")

</div>

If you want it to apply to every DRBD device, you would put it in the `global_common.conf`, within the `common` then `disk` section.

From the `drbd.conf` man page:

```plaintext
       read-balancing method
           The supported methods for load balancing of read requests are prefer-local, 
           prefer-remote, round-robin, least-pending, when-congested-remote, 
           32K-striping, 64K-striping, 128K-striping, 256K-striping, 512K-striping and 
           1M-striping.

           The default value of read-balancing is prefer-local. This option is available 
           since 8.4.1.

```

So something like this could be an example:

```plaintext
common {
...
        disk {
                # size on-io-error fencing disk-barrier disk-flushes
                # disk-drain md-flushes resync-rate resync-after al-extents
                # c-plan-ahead c-delay-target c-fill-target c-max-rate
                # c-min-rate disk-timeout

                read-balancing least-pending;
        }
}
...

```

If you only wanted it to apply to specific DRBD resources, you would put it within the `disk` section of that specific `resource` configuration rather than the `global_common.conf`

---

<div class="post-metadata">

### Author: ![sviridoff](https://yyz1.discourse-cdn.com/flex003/user_avatar/forums.linbit.com/sviridoff/32/255_2.png) [@sviridoff](https://forums.linbit.com/u/sviridoff)
#### Post date: [August 29, 2024, 1:35pm UTC](https://forums.linbit.com/t/seting-up-read-balancing-globaly/274/3 "2024-08-29T13:35:12Z")

</div>

Great!! Thank you so much, thats what I’m looking for.
