Peer-to-Peer Benchmark Example

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 for Running the Examples.
  1. In one session, start the consumer:

    $ java -cp "$GEMFIRE/SampleCode/quickstart/classes:$GEMFIRE/lib/server-dependencies.jar" quickstart.BenchmarkAckConsumer
  2. After the consumer starts, in another session, start the producer:

    $ java -cp "$GEMFIRE/SampleCode/quickstart/classes:$GEMFIRE/lib/server-dependencies.jar" quickstart.BenchmarkAckProducer

Example Source Files

Program and cache configuration files:

Table 1. Cache configuration files, located in SampleCode//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 SampleCode//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.