Peer-to-Peer Benchmark Example

The P2P benchmark measures entry distribution time in a single system. A producer puts entries and measures the time it takes for a distribution acknowledgment from a consumer. For this example, the producer and consumer have configured their data region to require acknowledgment of data distribution. The consumer region is configured as a replica, so it automatically receives all of the producer's puts.

Running the Example

Note: The tests run with a default number of samples, operations per sample, and payload. You can change these settings to better approximate your own systems. See Benchmark Parameters
Note: To run this example, you must have terminal sessions configured for the QuickStart examples, as described in Setting Up Your Environment.

  1. In one session, start the consumer:

    $ java quickstart.BenchmarkAckConsumer
  2. After the consumer starts, in another session, start the producer:

    $ java quickstart.BenchmarkAckProducer

Example Source Files

Program and cache configuration files:

Table 1. Cache configuration files, located in $SamplesDirectory/quickstart/xml
BenchmarkAckProducer.xml Configures a region for a distribution benchmark.
BenchmarkAckConsumer.xml Configures a region with replication for a distribution benchmark.
Table 2. Java program files, located in $SamplesDirectory/quickstart/quickstart Takes a timestamp, puts an entry value, waits for the ACK, and compares the current timestamp with the timestamp taken before the put. Creates the cache for the example.