DRDB and link compression

From lxadm | Linux administration tips, tutorials, HOWTOs and articles
Jump to: navigation, search

Recently I was setting up DRBD (in short: “block devices designed as a building block to form high availability (HA) clusters”) between two data centers.

DRBD doesn’t apply any form of compression on the data that is replicated; is it a good idea to enable compression in the VPN link if you replicate your data with DRBD over Internet? Here is a quick test.


I used OpenVPN with its lzo compression to test it, as it is easy to set up and to get the results.

tun0 interface is the “compressed” link; it shows the amount of data sent between two DRBD servers.

bond0 is the real network interface; as the underlying tun0 link sends data in compressed form, this one shows the real traffic.

As you can see by looking at “total” column, OpenVPN lzo compression saves us more than 50% of traffic. Not bad. I wonder how does IPsec’s IPcomp compare to OpenVPN’s lzo?

tun0
day ......... rx ... | .... tx ... | ... total
---------------------+-------------+--------------
04.06.      2292 MB  |   85.50 MB  |    2377 MB
05.06.      2085 MB  |   80.69 MB  |    2166 MB
06.06.      2585 MB  |   91.83 MB  |    2677 MB
07.06.      2047 MB  |   80.20 MB  |    2128 MB
08.06.      2298 MB  |   85.70 MB  |    2384 MB
09.06.      2440 MB  |   90.20 MB  |    2530 MB
10.06.      2461 MB  |   90.54 MB  |    2551 MB


bond0
04.06.      1035 MB  |  145.26 MB  |    1180 MB
05.06.    936.28 MB  |  130.98 MB  |    1067 MB
06.06.      1452 MB  |  157.91 MB  |    1610 MB
07.06.    885.48 MB  |  134.84 MB  |    1020 MB
08.06.    992.08 MB  |  147.36 MB  |    1139 MB
09.06.      1064 MB  |  151.25 MB  |    1215 MB
10.06.      1143 MB  |  154.26 MB  |    1297 MB

What was tested: a couple of virtual machines (Linux on Xen and Windows on VMware) with their block devices placed on LVM; LVM was placed on DRBD.

Note that “tx” for bond0 is bigger than “tx” for tun0; it is because DRBD server was exchanging data with other machines in LAN as well (backups etc.).

Compressing the link between two DRBD machines make sense over a WAN interface only (if you have to pay for the amount of data transferred, the link is too slow, or both); it doesn’t make much sense locally if you have 1 Gbit network or better.