Using LINSTOR to Tune DRBD for Write Performance
This article will help you to identify and tune DRBD® settings by using LINSTOR® to achieve the best write performance.
These instructions use LINSTOR, but the same configuration keys and values can be used directly in DRBD resource files in the appropriate section of the resource configuration file for each key.
Whether this is acceptable in real life usage situations depends on the details of the application and underlying storage. There are certainly real cases where it is acceptable, so it is fine for benchmarking.
WARNING: While fine for some quick benchmarking. In production, you should only disable device flushes when running DRBD on devices with a battery-backed write cache (BBWC). Most storage controllers allow for automatically disabling the write cache when the battery is depleted, switching to write-through mode when the battery dies. It is strongly recommended to enable such a feature.
$ linstor controller drbd-options --disk-flushes=no
$ linstor controller drbd-options --md-flushes=no
$ linstor controller drbd-options --max-buffers=10000
This will only have an effect if you are writing with very high concurrency:
$ linstor controller drbd-options --max-epoch-size=10000
Try using more, smaller devices and aggregating the performance. This can be easily achieved by creating more resource definitions. For example, eight volumes of 500GiB instead of one volume of 4TiB. This can remove bottlenecks caused by the concurrency and throughput limitations of a single device.
Tune the activity log. The activity log is described here if you want to understand the theory: DRBD 9 User Guide - 16.3. The Activity Log.
Or just try one of these commands:
$ linstor controller drbd-options --al-updates=no
$ linstor controller drbd-options --al-extents=65534
⚠️ WARNING: setting the
al-updates=no
option will completely disable the activity log. With no activity log DRBD will need to do a full-sync to recover in case of an unexpectedly lost Primary node (hard reboot, kernel panic, and so on).
Edited 2020-12-14 – DJV