DRBD限制及内存占用情况

容量限制

The current maximum device size is 1PiB (1 PetiByte = 1024 TibiByte1), DRBD needs about 32MiB RAM per TiB storage; so for 1PiB storage you are at 32GiB just for the DRBD bitmap. Having a bit more for the OS, userspace and buffer cache is left as an exercise for the reader.

内存占用详情

DRBD static memory usage:

  • per-TB 32MB of memory used, statically, independent of over how many DRBD minors it is spread

And a per-minor usage of up to: - sndbuf-size for the TCP connection (can be ignored) - PAGE_SIZE * max_buffers - probably some other small values (kernel structures or such) which can be ignored for normal cases

the max-buffer setting limits the amount of in-flight data. if nothing is in-flight, no such buffers are allocated.

if something is in-flight, these are allocated on the receiving side to be able to submit it to the block device.

so "up to" max-buffers on the receiving side, which on the sending side corresponds to that many dirty (write-out) pages, or to pages read in by the resync process.

we also have a small number of mempools, and a page pool emergency reserve to not stall during write-out caused by hard memory pressure.