2016-08-26 03:05:47 -04:00
### Steps to execute the benchmark
2016-07-26 05:01:22 -04:00
2018-11-08 09:32:47 -05:00
1. Build `client-benchmark-noop-api-plugin` with `./gradlew :client:client-benchmark-noop-api-plugin:assemble`
2021-03-05 00:42:06 -05:00
2. Install it on the target host with `bin/opensearch-plugin install file:///full/path/to/client-benchmark-noop-api-plugin.zip` .
3. Start OpenSearch on the target host (ideally *not* on the machine
2018-07-31 17:31:13 -04:00
that runs the benchmarks)
4. Run the benchmark with
```
./gradlew -p client/benchmark run --args ' params go here'
```
2016-07-26 05:01:22 -04:00
2018-07-31 17:31:13 -04:00
Everything in the `'` gets sent on the command line to JMH. The leading ` `
inside the `'` s is important. Without it parameters are sometimes sent to
gradle.
See below for some example invocations.
2016-07-26 05:01:22 -04:00
2016-08-26 03:05:47 -04:00
### Example benchmark
2016-07-26 05:01:22 -04:00
2016-08-26 03:05:47 -04:00
In general, you should define a few GC-related settings `-Xms8192M -Xmx8192M -XX:+UseConcMarkSweepGC -verbose:gc -XX:+PrintGCDetails` and keep an eye on GC activity. You can also define `-XX:+PrintCompilation` to see JIT activity.
2016-07-26 05:01:22 -04:00
2016-08-26 03:05:47 -04:00
#### Bulk indexing
2021-07-12 17:07:56 -04:00
Download benchmark data and decompress them.
2016-08-26 03:05:47 -04:00
2018-07-31 17:31:13 -04:00
Example invocation:
2016-07-26 05:01:22 -04:00
```
2018-07-31 17:31:13 -04:00
wget http://benchmarks.elasticsearch.org.s3.amazonaws.com/corpora/geonames/documents-2.json.bz2
bzip2 -d documents-2.json.bz2
mv documents-2.json client/benchmark/build
2022-04-26 13:21:31 -04:00
gradlew -p client/benchmark run --args ' rest bulk localhost build/documents-2.json geonames 8647880 5000'
2016-07-26 05:01:22 -04:00
```
2018-07-31 17:31:13 -04:00
The parameters are all in the `'` s and are in order:
2016-07-26 05:01:22 -04:00
2021-12-28 12:28:51 -05:00
* Client type: Use "rest"
2016-08-26 03:05:47 -04:00
* Benchmark type: Use either "bulk" or "search"
2021-03-05 00:42:06 -05:00
* Benchmark target host IP (the host where OpenSearch is running)
2016-07-26 05:01:22 -04:00
* full path to the file that should be bulk indexed
* name of the index
* number of documents in the file
* bulk size
2016-08-26 03:05:47 -04:00
2018-07-31 17:31:13 -04:00
#### Search
2016-08-26 03:05:47 -04:00
2018-07-31 17:31:13 -04:00
Example invocation:
2016-08-26 03:05:47 -04:00
```
2018-11-08 09:32:47 -05:00
./gradlew -p client/benchmark run --args ' rest search localhost geonames {"query":{"match_phrase":{"name":"Sankt Georgen"}}} 500,1000,1100,1200'
2016-08-26 03:05:47 -04:00
```
The parameters are in order:
2021-12-28 12:28:51 -05:00
* Client type: Use "rest"
2016-08-26 03:05:47 -04:00
* Benchmark type: Use either "bulk" or "search"
2021-03-05 00:42:06 -05:00
* Benchmark target host IP (the host where OpenSearch is running)
2016-08-26 03:05:47 -04:00
* name of the index
2021-12-28 12:28:51 -05:00
* a search request body (remember to escape double quotes).
2016-08-26 03:05:47 -04:00
* A comma-separated list of target throughput rates