Example Code - Aggregation Throughput Test

Note: Applies to RTI Data Distribution Service 4.3 and above.

The following example is written in C++.

Publisher

This throughput test is based on the throughput test in $NDDSHOME/example/CPP/performance/throughput, with modifications to batch data samples for aggregation. Instead of sending whenever write() is called, data samples are put into a batch. When the batch is full, everything in the batch is flushed, i.e. sent over the wire. 

All the data samples in a batch are sent as one packet, sharing headers and other overhead. However, the data samples can still be processed separately on the subscriber side. 

The -batch <batch_size> command-line argument has been added so you can set the number of data samples per batch.

When batching is used, the actual data size becomes batch_size x data size. Data size is specified by the -size flag (refer to the Instructions provided with the regular throughput test for information on the other command-line arguments). For example, a data size of 12 with a batch size of 5000 will actually send 60K on the wire per data packet. 

Subscriber

The subscriber side has a batched listener for the sample sequence data type. The processing remains the same as for the individual sample sequence.

The command-line arguments remain the same as well. 

Example Output

Data size 12 bytes, batch size 5000, 3.66 million msg/sec

Note that some message loss is expected because it is using best effort. 

./Throughput_publisher -nic 10.40.1.25 -transport 1 -peer 1@10.40.1.22 -domain 7 -demand 130000:5000:150000 -batch 5000 -size 12 

 Starting test... 
bytes, demand, samples, sample/s, Mbit/s, duration, CPU %, memory 
------, ------, --------, --------, -------, --------, -----, ------ 
12, 130000, 35360000, 2967807.4, 284.9, 11.91, 14.00, 111.5 
12, 135000, 36720000, 3665481.0, 351.9, 10.02, 16.94, 111.5 
12, 140000, 23660000, 1241426.1, 119.2, 19.06, 5.77, 111.5 
12, 145000, 37265000, 3722894.9, 357.4, 10.01, 17.31, 111.5 
12, 150000, 38100000, 3796836.5, 364.5, 10.03, 17.74, 111.5
./Throughput_subscriber -nic 10.40.1.22 -transport 1 -peer 0@10.40.1.25 -domain 7 

Starting test... 
bytes,demand, samples,sample/s, Mbit/s,lost(A),Nreject,lost(N), CPU %,memory 
------,------,--------,--------,-------,-------,-------,-------,------,------ 
12,130000,34910000,3568090.12, 342.5, 0, 0, 450000, 22.00, 424.4 
12,135000,35360000,3525449.49, 338.4, 0, 0,1360000, 21.69, 424.4 
12,140000,22815000,3645908.41, 350.0, 0, 0, 845000, 22.25, 424.4 
12,145000,35980000,3591917.91, 344.8, 0, 0,1285000, 22.41, 424.4 
12,150000,36620000,3647071.18, 350.1, 0, 0,1480000, 22.63, 424.4 

Data size 60 bytrres, batch size 1000, 1.9 million msg/sec

./Throughput_publisher -nic 10.40.1.22 -transport 1 -peer 1@10.40.1.25 -domain 7 -demand 900000:50000:4000000 -batch 1000 -size 60 

 Starting test... 
bytes, demand, samples, sample/s, Mbit/s, duration, CPU %, memory 
------, ------, --------, --------, -------, --------, -----, ------ 
60, 900000, 19800000, 1925056.3, 924.0, 10.29, 13.05, 111.0 
60, 950000, 19950000, 1924917.3, 924.0, 10.36, 12.93, 111.0 
60, 1000000, 20000000, 1928939.5, 925.9, 10.37, 13.09, 111.0 
60, 1050000, 19950000, 1930331.4, 926.6, 10.34, 13.21, 111.0 
60, 1100000, 19800000, 1931782.8, 927.3, 10.25, 12.93, 111.0
./Throughput_subscriber -nic 10.40.1.25 -transport 1 -peer 0@10.40.1.22 -domain 7 
Starting test... 
bytes,demand, samples,sample/s, Mbit/s,lost(A),Nreject,lost(N), CPU %,memory 
------,------,--------,--------,-------,-------,-------,-------,------,------ 
60,900000,19800000,1925501.81, 924.2, 0, 0, 0, 18.60, 425.3 
60,950000,19950000,1925691.16, 924.3, 0, 0, 0, 18.85, 425.3 
60,1000000,20000000,1929002.35, 925.9, 0, 0, 0, 18.28, 425.3 
60,1050000,19950000,1929763.81, 926.3, 0, 0, 0, 18.57, 425.3 
60,1100000,19800000,1932070.60, 927.4, 0, 0, 0, 18.81, 425.3
Programming Language: