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 read intensive workloads, balancing read I/O operations between nodes can give you significant improvements. If your network gear allows, you can simply multiply the performance.

While writes occur on both sides of the cluster, by default the reads are served locally, that is, the default read-balancing policy is prefer-local. This might not be optimal if you’ve got a big pipe to the other node and a heavily loaded I/O subsystem.

Read-balancing with DRBD has several policy options to choose from:

  • Read striping, 32K-striping up to 1M-striping, chooses the node to read from through the block address. This is a simple, static load-balancing. For example, for 512K-striping the first half of each MiByte would be read from one machine, and the second half from the other [1].
  • The round-robin policy just passes read requests to alternating nodes. This might go wrong if your application reads 4kiB, 1MiB, 4kiB, 1MiB, and so on — but this is fairly unlikely.
  • The least-pending policy chooses the node with the smallest number of open requests.
  • The when-congested-remote policy uses the remote node if there are local requests, using the Linux kernel variable, bdi_read_congested, to decide [2].
  • The prefer-remote policy is implemented for completeness, however as of this writing there is no viable use case.

Please note that all this is still below the file system layer — so even if the Secondary node is used for reading, this won’t speed up a failover, as the pages read are not kept anywhere.

  1. Please note that the distinction is done through the start address of the request, and no request splitting is done. So if your file system and application work with a block size of 1MiByte, every setting lower than 1M-striping would use the same node.
  2. See include/linux/backing-dev.h.
Share on facebook
Share on twitter
Share on linkedin
Share on reddit
Share on whatsapp
Share on vk
Share on email

Share this post

Yusuf Yıldız

Yusuf Yıldız

After nearly 15 years of system and storage management, Yusuf started to work as a solution architect at Linbit. Yusuf's main focus is on customer success and contributing to product development and testing. As part of the solution architects team, he is one of the backbone and supporter of the sales team.

Talk to us

LINBIT is committed to protecting and respecting your privacy, and we’ll only use your personal information to administer your account and to provide the products and services you requested from us. From time to time, we would like to contact you about our products and services, as well as other content that may be of interest to you. If you consent to us contacting you for this purpose, please tick above to say how you would like us to contact you.

You can unsubscribe from these communications at any time. For more information on how to unsubscribe, our privacy practices, and how we are committed to protecting and respecting your privacy, please review our Privacy Policy.

By clicking submit below, you consent to allow LINBIT to store and process the personal information submitted above to provide you the content requested.

Talk to us

LINBIT is committed to protecting and respecting your privacy, and we’ll only use your personal information to administer your account and to provide the products and services you requested from us. From time to time, we would like to contact you about our products and services, as well as other content that may be of interest to you. If you consent to us contacting you for this purpose, please tick above to say how you would like us to contact you.

You can unsubscribe from these communications at any time. For more information on how to unsubscribe, our privacy practices, and how we are committed to protecting and respecting your privacy, please review our Privacy Policy.

By clicking submit below, you consent to allow LINBIT to store and process the personal information submitted above to provide you the content requested.