Configuring OpenSearch Benchmark

OpenSearch Benchmark configuration data is stored in ~/.benchmark/benchmark.ini, which is automatically created the first time OpenSearch Benchmark runs.

The file is separated into the following sections, which you can customize based on the needs of your cluster.

meta

This section contains meta information about the configuration file.

ParameterTypeDescription
config.versionIntegerThe version of the configuration file format. This property is managed by OpenSearch Benchmark and should not be changed.

system

This section contains global information for the current benchmark environment. This information should be identical on all machines on which OpenSearch Benchmark is installed.

ParameterTypeDescription
env.nameStringThe name of the benchmark environment used as metadata in metrics documents when an OpenSearch metrics store is configured. Only alphanumeric characters are allowed. Default is local.
available.coresIntegerDetermines the number of available CPU cores. OpenSearch Benchmark aims to create one asyncio event loop per core and distributes it to clients evenly across event loops. Defaults to the number of logical CPU cores for your cluster.
async.debugBooleanEnables debug mode on OpenSearch Benchmark’s asyncio event loop. Default is false.
passenvStringA comma-separated list of environment variable names that should be passed to OpenSearch for processing.

node

This section contains node-specific information that can be customized according to the needs of your cluster.

ParameterTypeDescription
root.dirStringThe directory that stores all OpenSearch Benchmark data. OpenSearch Benchmark assumes control over this directory and all its subdirectories.
src.root.dirStringThe directory from which the OpenSearch source code and any OpenSearch plugins are called. Only relevant for benchmarks from sources.

source

This section contains more details about the OpenSearch source tree.

ParameterTypeDescription
remote.repo.urlURLThe URL from which to check out OpenSearch. Default is https://github.com/opensearch-project/OpenSearch.git.
opensearch.src.subdirStringThe local path relative to the src.root.dir of the OpenSearch search tree. Default is OpenSearch.
cacheBooleanEnables OpenSearch’s internal source artifact cache, opensearch*.tar.gz, and any plugin zip files. Artifacts are cached based on their Git revision. Default is true.
cache.daysIntegerThe number of days that an artifact should be kept in the source artifact cache. Default is 7.

benchmarks

This section contains the settings that can be customized in the OpenSearch Benchmark data directory.

ParameterTypeDescription
local.dataset.cacheStringThe directory in which benchmark datasets are stored. Depending on the benchmarks that are run, this directory may contain hundreds of GB of data. Default path is $HOME/.benchmark/benchmarks/data.

results_publishing

This section defines how benchmark metrics are stored.

ParameterTypeDescription
datastore.typeStringIf set to in-memory all metrics are kept in memory while running the benchmark. If set to opensearch all metrics are instead written to a persistent metrics store and the data is made available for further analysis. Default is in-memory.
sample.queue.sizeFunctionThe number of metrics samples that can be stored in OpenSearch Benchmark’s in-memory queue. Default is 2^20.
metrics.request.downsample.factorInteger(default: 1): Determines how many service time and latency samples are saved in the metrics store. By default, all values are saved. If you want to, for example. keep only every 100th sample, specify 100. This is useful to avoid overwhelming the metrics store in benchmarks with many clients. Default is 1.
output.processingtimeBooleanIf set to true, OpenSearch shows the additional metric processing time in the command line report. Default is false.

datastore.type parameters

When datastore.type is set to opensearch, the following reporting settings can be customized.

ParameterTypeDescription
datastore.hostIP addressThe hostname of the metrics store, for example, 124.340.200.22.
datastore.portPortThe port number of the metrics store, for example, 9200.
datastore.secureBooleanIf set to false, OpenSearch assumes an HTTP connection. If set to true, it assumes an HTTPS connection.
datastore.ssl.verification_modeStringWhen set to the default full, the metrics store’s SSL certificate is checked. To disable certificate verification, set this value to none.
datastore.ssl.certificate_authoritiesStringDetermines the local file system path to the certificate authority’s signing certificate.
datastore.userUsernameSets the username for the metrics store
datastore.password:StringSets the password for the metrics store. Alternatively, this password can be configured using the OSB_DATASTORE_PASSWORD environment variable, which avoids storing credentials in a plain text file. The environment variable takes precedence over the config file if both define a password.
datastore.probe.cluster_versionStringEnables automatic detection of the metrics store’s version. Default is true.
datastore.number_of_shardsIntegerThe number of primary shards that the opensearch- indexes should have. Any updates to this setting after initial index creation will only be applied to new opensearch- indexes. Default is the OpenSearch static index value.
datastore.number_of_replicasIntegerThe number of replicas each primary shard in the datastore contains. Any updates to this setting after initial index creation will only be applied to new opensearch-* indexes. Default is the OpenSearch static index value.

Examples

You can use the following examples to set reporting values in your cluster.

This example defines an unprotected metrics store in the local network:

  1. [results_publishing]
  2. datastore.type = opensearch
  3. datastore.host = 192.168.10.17
  4. datastore.port = 9200
  5. datastore.secure = false
  6. datastore.user =
  7. datastore.password =

This example defines a secure connection to a metrics store in the local network with a self-signed certificate:

  1. [results_publishing]
  2. datastore.type = opensearch
  3. datastore.host = 192.168.10.22
  4. datastore.port = 9200
  5. datastore.secure = true
  6. datastore.ssl.verification_mode = none
  7. datastore.user = user-name
  8. datastore.password = the-password-to-your-cluster

workloads

This section defines how workloads are retrieved. All keys are read by OpenSearch using the syntax <<workload-repository-name>>.url, which you can select using the OpenSearch Benchmark CLI --workload-repository=workload-repository-name" option. By default, OpenSearch chooses the workload repository using the default.url https://github.com/opensearch-project/opensearch-benchmark-workloads.

defaults

This section defines the default values of certain OpenSearch Benchmark CLI parameters.

ParameterTypeDescription
preserve_benchmark_candidateBooleanDetermines whether OpenSearch installations are preserved or wiped by default after a benchmark. To preserve an installation for a single benchmark, use the command line flag —preserve-install. Default is false.

distributions

This section defines how OpenSearch versions are distributed.

ParameterTypeDescription
release.cacheBooleanDetermines whether newly released OpenSearch versions should be cached locally.

Proxy configurations

OpenSearch automatically downloads all the necessary proxy data for you, including:

  • OpenSearch distributions, when you specify --distribution-version=<OPENSEARCH-VERSION>.
  • OpenSearch source code, when you specify a Git revision number, for example, --revision=1e04b2w.
  • Any metadata tracked from the OpenSearch GitHub repository.

As of OpenSearch Benchmark 0.5.0, only http_proxy is supported.

You can use an http_proxy to connect OpenSearch Benchmark to a specific proxy and connect the proxy to a benchmark workload. To add the proxy:

  1. Add your proxy URL to your shell profile:

    1. export http_proxy=http://proxy.proxy.org:4444/
  2. Source your shell profile and verify that the proxy URL is set correctly:

    1. source ~/.bash_profile ; echo $http_proxy
  3. Configure Git to connect to your proxy by using the following command. For more information, see the Git documentation.

    1. git config --global http_proxy $http_proxy
  4. Use git clone to clone the workloads repository by using the following command. If the proxy configured correctly, the clone is successful.

    1. git clone http://github.com/opensearch-project/opensearch-benchmark-workloads.git
  5. Lastly, verify that OpenSearch Benchmark can connect to the proxy server by checking the /.benchmark/logs/benchmark.log log. When OpenSearch Benchmark starts, you should see the following at the top of the log:

    1. Connecting via proxy URL [http://proxy.proxy.org:4444/] to the Internet (picked up from the environment variable [http_proxy]).

Logging

Logs from OpenSearch Benchmark can be configured in the ~/.benchmark/logging.json file. For more information about how to format the log file, see the following Python documentation:

By default, OpenSearch Benchmark logs all output to ~/.benchmark/logs/benchmark.log.