Client Server Benchmark Example

Client Server Benchmark Example

This example measures client-to-server entry distribution. The client puts data into its cache and measures the time it takes for the put to return. The measurements include the time required to send the data to the server.

The example is configured for client and server that are run on the same host machine. To run them on separate machines, under the client's quickstart directory, edit xml/BenchmarkClient.xml, locate the <server> element, and change "localhost" to your server's machine name or address. For example, if you run the server on a machine named freddy, the <server> element in the client's xml/BenchmarkClient.xml should look like this:

<server host="freddy" port="40404"/>

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 server:

    $ gfsh start server --name=server_bms --cache-xml-file=xml/BenchmarkServer.xml --classpath="$GEMFIRE/SampleCode/quickstart/classes"

    The gfsh command starts a cache server in the background, displays the status of the server and some environment information, and then exits to the command prompt.

  2. Start the client session.

    If you are running client and server on the same machine, you can start the client in the same session as the server. If you are running on separate machines, start a client session on the second machine. Use this command to start the client:

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

    The client executes some benchmarking operations and then displays the results. (The client can take several minutes to complete this task.)

  3. After the client exits, stop the cache server in the server's session:

    $ gfsh stop server --dir=server_bms

Example Source Files

Program and cache configuration source files (the server is a GemFire cacheserver process and does not have an example source file):

Table 1. Cache configuration files, located in SampleCode//quickstart/xml
BenchmarkServer.xml Configures a cache to serve caching clients at port 40404.
BenchmarkClient.xml Configures a region as a client region in a client/server cache.
Table 2. Java program files, located in SampleCode/quickstart/quickstart Measures the time it takes for a client put to return in a hierarchical cache configuration.