Appearance
Replication Performance Benchmark
This document provides detailed replication benchmarks obtained using Yellowbrick version 7.2.0-69679. All measurements were performed with two 6-blade Andromeda second generation appliances connected by a 10 Gbps network link. A peak replication rate of 0.981 GB/s was recorded from the primary and secondary for a single replica, which represents 86% of the available network capacity.
Benchmark Setup
Environment
| Parameter | Value |
|---|---|
| Source Appliance | Andromeda (6 blades, v7.2.0-69679) |
| Destination Appliance | Andromeda (6 blades, v7.2.0-69679) |
| Network Bandwidth | 9.42 Gbps (iperf 30 s, 8 streams) |
| Memory per Compute Node | 512 GB |
| WLM Profile | Default |
| Database Encoding | LATIN9 |
| Total Rows | 24,576,024,576 |
| Compressed size | 630.8 GB |
| Uncompressed size | 2.2 TB |
| Compression ratio | 3.5× |
| Average row size | 27.56 bytes |
Table Definition
sql
CREATE TABLE public.addition_1 (
worker_id UUID NOT NULL,
worker_lid SMALLINT NOT NULL,
node_id INTEGER NOT NULL,
thread_id SMALLINT NOT NULL,
range BIGINT NOT NULL,
range_min BIGINT NOT NULL,
range_max BIGINT NOT NULL,
row_number BIGINT NOT NULL,
random_seed BIGINT NOT NULL,
random BIGINT NOT NULL
)
DISTRIBUTE RANDOM;Query to Populate Table
The following query was used to populate the test table.
sql
CREATE TABLE public.addition_1 AS SELECT * FROM sys.rowgenerator;
INSERT INTO public.addition_1 SELECT * from public.addition_1;
-- Repeat until the table reaches a size that saturates replication bandwidth,
-- minimizing overhead from startup or I/O latency.
-- In our tests we used ~ 630GB but we could reach network saturation at earlier sizes
-- such as 100GB.Baseline: Replication Without Additional Workload
Each replica was created using the following command:
sql
ALTER DATABASE "<database_name>" ADD REPLICA "<replica_name>"
TO "<remote_server>"
WITH (
frequency 99999,
alias '<replica_db_name>'
);Once created, the replica was started with:
sql
ALTER DATABASE "<database_name>" ALTER REPLICA "<replica_name>" START;This resulted in the following throughput and timings on the benchmarked system:
| Metric | Value |
|---|---|
| Bytes sent | 881,083,886,988 |
| Elapsed time | 14 minutes 35.96 seconds (875,959 ms) |
| Bandwidth | 8,046.80 MiB/s (1,005 MB/s) |
The single replication workload used 86% of the measured network bandwidth:
| Metric | Value |
|---|---|
| Measured iperf bandwidth | 9.42 Gbps |
| Replication throughput | 8.05 Gbps |
| Utilization of capacity | 85.5% |
Scalability: Two Concurrent Replication Workloads
Further tests were run with 2 and 4 replicas operating in parallel. The replication process was forced to complete one full cycle in each case.
| Replica Count | Bytes Sent | Elapsed Time | Bandwidth (MiB/s) | Bandwidth (MB/s) | Replica Name |
|---|---|---|---|---|---|
| 1 | 881,107,588,913 | 14 min 35.96 sec | 8,046.80 | 1,005 | repl_test_bandwidth_a |
| 2 | 881,112,026,799 | 26 min 6.15 sec | 4,502.62 | 562 | repl_test_bandwidth_b |
| 2 | 881,107,588,913 | 26 min 7.52 sec | 4,496.83 | 562 | repl_test_bandwidth_c |
| 4 | 880,736,450,364 | 55 min 24.51 sec | 2,119.38 | 264 | repl_test_bandwidth_d |
| 4 | 880,642,224,292 | 55 min 25.92 sec | 2,118.25 | 264 | repl_test_bandwidth_e |
| 4 | 881,295,115,690 | 55 min 26.06 sec | 2,119.73 | 264 | repl_test_bandwidth_f |
| 4 | 881,774,587,795 | 55 min 27.19 sec | 2,120.17 | 265 | repl_test_bandwidth_g |
Parallel replication tasks were started with the following commands, in the case of 4 replicas:
sql
-- The following 4 operations are asynchronous
alter database "repl_parallel_1" alter replica "repl_test_bandwidth_d" start;
alter database "repl_parallel_2" alter replica "repl_test_bandwidth_e" start;
alter database "repl_parallel_3" alter replica "repl_test_bandwidth_f" start;
alter database "repl_parallel_4" alter replica "repl_test_bandwidth_g" start;Observations
- Single Replica: Achieved 1,005 MB/s (≈8.05 Gbps), which is 86% of the measured 9.42 Gbps network bandwidth. This indicates good single-stream efficiency and a likely underutilization of the CPUs.
- Two Replicas: Each replica achieved 562 MB/s, summing to 1,124 MB/s (≈ 9.0 Gbps). This is within 4.5% of total capacity, indicating full network utilization, with minor inefficiencies from concurrency overhead, and full CPU utilization.
- Four Replicas: Each replica achieved 264–265 MB/s, totaling 1,056 MB/s (≈ 8.45 Gbps). This shows the network remained saturated, but additional parallelism did not increase total throughput, suggesting a network bottleneck — not a CPU or disk I/O bottleneck.
Delete & Update Operation Performance
Delete and update operations are more expensive than a simple append operation. This is because additional metadata must be sent from the source system to the destination. This can range between 4 bytes (with compression) to ≈130 bytes per deleted / updated row (rowupdated, rowunique, rowtxid).
The performance of the delete operation is highly influenced by how much memory a query executed on the destination system can claim from the applied WLM profile. We recommend allowing at last 25 GB of memory for these types of queries.
Those queries are generally of the form:
sql
DELETE WITH NO TABLEDELETE FROM public.test_delete
WHERE
rowtxid != 73370
AND rowunique % 4 = 1
AND rowunique IN(
SELECT rowunique
FROM public.test_delete
WHERE rowtxid = 73370 AND rowunique % 4 = 1
AND rowupdated = 't'
UNION ALL SELECT rowunique
FROM public.yb_deletes_17962
WHERE
rowtxid = 73370 AND rowunique % 4 = 1
)The compute cluster that the data is being replicated to will partition the query execution into N buckets depending on the available memory set by the WLM profile (in the example above, the query was executed in a batch of 4 — rowunique % 4).
For example, the following replication cycle included the deletion of all 24,576,024,576 records, and resulted in the following benchmarks:
| Metric | Value |
|---|---|
| sent_bytes | 101,214,543,909 |
| elapsed_ms | 189,063 |
| elapsed_time | 3m 9.06s |
| bandwidth_mib/s | 4,282.79 |
| bandwidth_MB/s | 535 |
In the above table, sent_bytes represents the size of the metadata sent from the source to the destination during replication.
The time spent performing the delete operations can be determined by adding up the delete queries:
sql
yellowbrick=# select sum(total_ms) from sys.log_query where query_text ilike '%yb_deletes_17962%' and type = 'delete';
-----------
90054.536
(1 row)It follows that the rate of deletion on the replica was ≈ 272 million rows per second:
| Metric | Value |
|---|---|
| Rows Deleted | 24,576,024,576 |
| Elapsed time | 1 minute 30.05 seconds (90,055 ms) |
| Rows Deleted/s | 272 million |
Fixed Overhead Per Table
There is a fixed cost for replicating a single table regardless of the replication operations performed. To demonstrate this, create a database with 1,000 tables each containing a single row, and then start a replication process:
sql
-- Connected to the DB to be replicated. The simple SQL block simulated 1000 tables
-- that need to be replicated as they contain data.
DO $$
DECLARE
i INT;
BEGIN
FOR i IN 1..1000 LOOP
EXECUTE format('CREATE TABLE public.t%s (x INTEGER);', i);
EXECUTE format('INSERT INTO public.t%s VALUES (1);', i);
END LOOP;
END;
$$;
alter database "repl_overhead_per_table" add replica "repl_overhead_per_table_repl" to "remote_server" with (frequency 60, alias repl_overhead_per_table_copy);
alter database "repl_overhead_per_table" alter replica "repl_overhead_per_table_repl" start;The results at the end of the single replication cycle were:
| Metric | Value |
|---|---|
| Total bytes sent | 243,000 |
| Elapsed time | 4 minutes 26.39 seconds |
| Average overhead/table | ≈266 ms |
The implication of this ≈266 ms per table replicated overhead is that high table counts with frequent small updates may degrade overall replication performance. This overhead imposes a fundamental limit on how many tables can be replicated over a given period of time:
| Time Budget (seconds) | Maximum Number of Replicated Tables |
|---|---|
| 5 | 18 |
| 60 | 225 |
| 300 (5 minutes) | 1,126 |
| 1,800 (30 minutes) | 6,757 |
The recommendation here is to group operations when possible. Use temporary tables that are automatically excluded from replication for staging operations. Use replication’s exclude schema option to exclude entire schemas that are constantly modified that shouldn’t be replicated.
Formula to Determine Table Count and Replicated Data Limits
Given the fixed per-table replication overhead and the throughput rates measured, use the following constraint to help plan your replication setup:
Constraint: (maxTables × 0.266) + (maxData / 0.981) ≤ 3600
Where:
- maxTables — number of tables replicated
- maxData — size of data replicated (in GB)
- 0.266 s — fixed cost per table
- 0.981 GB/s — effective data replication rate
This formula leads to the following example constraints:
| Time Budget (seconds) | Max Tables | Max Data (GB) |
|---|---|---|
| 300 (5 min) | 1 | 297.3 |
| 300 | 1,000 | 35.3 |
| 300 | 500 | 164.5 |
| 600 (10 min) | 2,000 | 70.7 |
| 1,800 (30 min) | 6,000 | 885.5 |
| 3,600 (1 hour) | 5,800 | 2,000 |