Tuning DRBD's ko-count for DRBD Proxy

This article will explain how you should tune DRBD's ko-count setting for use with DRBD Proxy.

The following equation should hold true. You need to set your "(timeout/10) *ko-count", to be greater than the amount of time it takes to flush a full proxy buffer. We divide the value of "timeout" by 10, as it's measured in tenths of a second. ko-count is set to 7 by default, timeout is set to 60 by default.

(memlimit MB) / (Bandwidth MB/s) < (timeout/10)s * (ko-count)

So for example, if you had a 10MB/s link, and a Proxy buffer 500MB in size, you'd start with the equation:

500 MB / 10 MB/s < (60/10)s * 7

Which works out to (which isn't true):

50s < 42s

To make the equation true, you could tune ko-count up to 9, or timeout up to 80. LINBIT recommends tuning ko-count over timeout because the ko-count option was designed for this use case, while adjusting timeout could effect other DRBD behaviors. Adjusting ko-count up to 9 results in the following:

500MB / 10MB/s < (60/10)s * 9

50s < 54s

Tuning your ko-count appropriately will allow DRBD to more gracefully disconnect from a peer that is having difficulty flushing replicated writes to disk, which could otherwise cripple performance on the Primary node.

 

Reviewed 2020/12/01 - DGT