Replication Bandwidth Allocation
Replication Bandwidth Allocation
This article illustrates how to calculate the bandwidth allocation for a replication.The replication bandwidth calculation is necessary in order to estimate the network resource use.
This method of calculating the bandwidth is suitable for the "proxy" and "persister" replication.
1 Environment
- 2 servers;
- Tomcat 6.0.13;
- JCR Replication used 'persistent' mode;
- OS (Linux Ubuntu 8,04, Windows XP SP2).
2 Bytes per operation
String / binary(1MB) property and nt:base node can be used as blocks for custom structures. Empty Node| N, iterations | INPUT, bytes | OUTPUT, bytes | Total, bytes | Time | Bytes per empty node |
|---|---|---|---|---|---|
| 10000 | 19249327 | 25205734 | 44455061 | 3 m 15 s | 4445,51 |
| 50000 | 95863123 | 125727728 | 221590851 | 11m 36 s | 4431,82 |
| 100000 | 191519666 | 250909576 | 442429242 | 19 m 5 s | 4424,29 |
| Average | 4433,87 |
All other types (Boolean, Date, etc.) use as much bytes as a String property.
| N, iterations | INPUT, bytes | OUTPUT, bytes | Total, bytes | Time | Bytes per 128B string property |
|---|---|---|---|---|---|
| 10000 | 19608376 | 25604135 | 45212511 | 2 m 50 s | 4521,25 |
| 50000 | 98602738 | 129320997 | 227923735 | 8 m 45 s | 4558,47 |
| 100000 | 199219144 | 263427210 | 462646354 | 15 m 6 s | 4626,46 |
| Average | 4568,73 |
The 1MB binary property will be used for the calculation of binary properties.
| N, iterations | INPUT, bytes | OUTPUT, bytes | Total, bytes | Time | Bytes per 1MB binary property |
|---|---|---|---|---|---|
| 100 | 1801627 | 111664681 | 113466308 | 2 m 25 s | 1134663,08 |
| 500 | 8828816 | 561960226 | 570789042 | 7 m 13 s | 1141578,08 |
| 1000 | 22544943 | 1302125002 | 1324669945 | 14 m 49 s | 1324669,95 |
| Average | 1200303,7 |
3 Bandwidth Allocation Formula
BABPS= (ENPS * BPEN + 128SPPS * BP128SP + 1MBBPPS * BP1MBBP) * (CP - 1)BAMBPS= BABPS / (1024 * 1024)?
BAMbPS= BAMBPS * 8
Variables:
BABPS -- bandwidth allocation, bytes per second
BAMBPS -- bandwidth allocation, Mbyte per second
BAMbPS -- bandwidth allocation, Mbit per second
CP -- clusters participants
ENPS -- empty node per second
128SPPS -- 128 length string property per second
1MBBPPS -- 1MB binary property per second
BPEN = 4433,87 -- bytes per empty node
BP128SP = 4568,73 -- bytes per 128 length string property
BP1MBBP = 1200303,7 -- bytes per 1MB binary property
4 Calculation Example
For this example let's suppose we add nodes of the following type: nt:unstructured with 3 properties (2MB binary, 2 string, 1 date).These nodes will be added at the speed of 2 nodes per second. 2 servers are used for replication. CP = 2
ENPS = 1
128SPPS = (2 string properties + 1 date property) = 3
1MBBPPS = 2
Bandwidth allocation :
BABPS = (ENPS * BPEN + 128SPPS * BP128SP + 1MBBPPS* BP1MBBP) * (CP - 1) =
(1 * 4433.87 + 3 * 4568.73 + 2 * 1200303.7) * (2 - 1) = 2418747,46 bytes per second
BAMBPS = BABPS / (1024 * 1024) = 2,306 Mbytes per second
BAMbPS = BAMBPS * 8 = 18,453 Mbit per second
Fore more details open http://wiki.exoplatform.com/xwiki/bin/download/JCR/Replication+bandwidth+allocation/ReplicationBandwidthTest.ods