Configuring SmartObserve Benchmark
SmartObserve Benchmark configuration data is stored in ~/.benchmark/benchmark.ini, which is automatically created the first time SmartObserve Benchmark runs.
The file is separated into the following sections, which you can customize based on the needs of your cluster.
client_options
This section explains how to customize client-level settings during benchmark execution using the --client-options command line flag.
You can pass client-specific parameters to SmartObserve Benchmark using the --client-options flag. These parameters let you control low-level client behavior such as timeouts, authentication methods, and SSL settings.
The --client-options flag accepts a comma-separated list of key-value pairs, as shown in the following example:
--client-options=timeout:120,verify_certs:false
You can customize --client-options with the following settings.
| Option | Type | Description |
|---|---|---|
timeout | Integer | Sets the request timeout value in seconds. |
verify_certs | Boolean | Determines whether to verify SSL certificates when connecting to the SmartObserve cluster. |
This example runs a benchmark with a 2-minute timeout and disabled certificate verification:
smartobserve-benchmark run \
--target-hosts=https://localhost:9200 \
--pipeline=benchmark-only \
--workload=geonames \
--client-options=timeout:120,verify_certs:false
meta
This section contains meta information about the configuration file.
| Parameter | Type | Description |
|---|---|---|
config.version | Integer | The version of the configuration file format. This property is managed by SmartObserve 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 SmartObserve Benchmark is installed.
| Parameter | Type | Description |
|---|---|---|
env.name | String | The name of the benchmark environment used as metadata in metrics documents when an SmartObserve metrics store is configured. Only alphanumeric characters are allowed. Default is local. |
available.cores | Integer | Determines the number of available CPU cores. SmartObserve 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.debug | Boolean | Enables debug mode on SmartObserve Benchmark’s asyncio event loop. Default is false. |
passenv | String | A comma-separated list of environment variable names that should be passed to SmartObserve for processing. |
node
This section contains node-specific information that can be customized according to the needs of your cluster.
| Parameter | Type | Description |
|---|---|---|
root.dir | String | The directory that stores all SmartObserve Benchmark data. SmartObserve Benchmark assumes control over this directory and all its subdirectories. |
src.root.dir | String | The directory from which the SmartObserve source code and any SmartObserve plugins are called. Only relevant for benchmarks from sources. |
source
This section contains more details about the SmartObserve source tree.
| Parameter | Type | Description |
|---|---|---|
remote.repo.url | URL | The URL from which to check out SmartObserve. Default is https://github.com/igsl-group/SmartObserve.git. |
smartobserve.src.subdir | String | The local path relative to the src.root.dir of the SmartObserve search tree. Default is SmartObserve. |
cache | Boolean | Enables SmartObserve’s internal source artifact cache, smartobserve*.tar.gz, and any plugin zip files. Artifacts are cached based on their Git revision. Default is true. |
cache.days | Integer | The 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 SmartObserve Benchmark data directory.
| Parameter | Type | Description |
|---|---|---|
local.dataset.cache | String | The 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. |
reporting
This section defines how benchmark metrics are stored.
| Parameter | Type | Description |
|---|---|---|
datastore.type | String | If set to in-memory all metrics are kept in memory while running the benchmark. If set to smartobserve 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.size | Function | The number of metric samples that can be stored in SmartObserve Benchmark’s in-memory queue. Default is 2^20. |
| metrics.request.downsample.factor | Integer | (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.processingtime | Boolean | If set to true, SmartObserve shows the additional metric processing time in the command line report. Default is false. |
datastore.type parameters
When datastore.type is set to smartobserve, the following reporting settings can be customized.
| Parameter | Type | Description |
|---|---|---|
datastore.host | IP address | The hostname of the metrics store, for example, 124.340.200.22. |
| datastore.port | Port | The port number of the metrics store, for example, 9200. |
datastore.secure | Boolean | If set to false, SmartObserve assumes an HTTP connection. If set to true, it assumes an HTTPS connection. |
datastore.ssl.verification_mode | String | When 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_authorities | String | Determines the local file system path to the certificate authority’s signing certificate. |
datastore.user | Username | Sets the username for the metrics store |
datastore.password | String | Sets 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_version | String | Enables automatic detection of the metrics store’s version. Default is true. |
datastore.number_of_shards | Integer | The number of primary shards that the smartobserve-* indexes should have. Any updates to this setting after initial index creation will only be applied to new smartobserve-* indexes. Default is the SmartObserve static index value. |
datastore.number_of_replicas | Integer | The 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 smartobserve-* indexes. Default is the SmartObserve 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:
[reporting]
datastore.type = smartobserve
datastore.host = 192.168.10.17
datastore.port = 9200
datastore.secure = false
datastore.user =
datastore.password =
This example defines a secure connection to a metrics store in the local network with a self-signed certificate:
[reporting]
datastore.type = smartobserve
datastore.host = 192.168.10.22
datastore.port = 9200
datastore.secure = true
datastore.ssl.verification_mode = none
datastore.user = user-name
datastore.password = the-password-to-your-cluster
workloads
This section defines how workloads are retrieved. All keys are read by SmartObserve using the syntax <<workload-repository-name>>.url, which you can select using the SmartObserve Benchmark CLI --workload-repository=workload-repository-name" option. By default, SmartObserve chooses the workload repository using the default.url https://github.com/igsl-group/smartobserve-benchmark-workloads.
defaults
This section defines the default values of certain SmartObserve Benchmark CLI parameters.
| Parameter | Type | Description |
|---|---|---|
preserve_benchmark_candidate | Boolean | Determines whether SmartObserve 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 SmartObserve versions are distributed.
| Parameter | Type | Description |
|---|---|---|
release.cache | Boolean | Determines whether newly released SmartObserve versions should be cached locally. |
Running SmartObserve Benchmark with AWS Signature Version 4
SmartObserve Benchmark supports AWS Signature Version 4 authentication. To run SmartObserve Benchmark with AWS Signature Version 4, you need to set up an AWS Identity and Access Management (IAM) user or role and provide it access to the SmartObserve cluster using AWS Signature Version 4 authentication.
Whether to use an IAM role or user depends on your test cluster’s access management requirements. For more information about whether to use an IAM role or user, see When to create an IAM user (instead of a role).
SmartObserve Benchmark version 1.15.0 and later
Starting with SmartObserve Benchmark version 1.15.0, you can use session-based authentication that automatically handles temporary credential generation and refresh. This method eliminates the need to manually export AWS credentials:
-
Create an IAM role or user in the AWS Management Console that has the necessary permissions to access your SmartObserve cluster. Ensure that the role or user has the required policies attached for SmartObserve access.
-
Run the following
execute-testcommand with the--client-options=amazon_aws_log_in:sessionflag. SmartObserve Benchmark will automatically generate temporary credentials and handle auto-refresh:smartobserve-benchmark execute-test \ --target-hosts=<CLUSTER ENDPOINT> \ --pipeline=benchmark-only \ --workload=geonames \ --client-options=timeout:120,amazon_aws_log_in:session,region:<region>,service:<aoss for serverless, es for managed service>
SmartObserve Benchmark version 1.14.0 and earlier
For SmartObserve Benchmark versions prior to 1.15.0, use the environment variable method:
-
Create an IAM role or user in the AWS Management Console.
-
Set up your environment variables. If you’re testing using Amazon SmartObserve Serverless, set
OSB_SERVICEtoaoss.- For an IAM user, configure the following environment variables:
export OSB_AWS_ACCESS_KEY_ID=<IAM USER AWS ACCESS KEY ID> export OSB_AWS_SECRET_ACCESS_KEY=<IAM USER AWS SECRET ACCESS KEY> export OSB_REGION=<YOUR REGION> export OSB_SERVICE=es- For an IAM role, configure the following environment variables:
export OSB_AWS_ACCESS_KEY_ID=<IAM Role AWS ACCESS KEY ID> export OSB_AWS_SECRET_ACCESS_KEY=<IAM Role AWS SECRET ACCESS KEY> export OSB_AWS_SESSION_TOKEN=<IAM Role SESSION TOKEN> export OSB_REGION=<YOUR REGION> export OSB_SERVICE=es -
Customize and run the following
runcommand with the--client-options=amazon_aws_log_in:environmentflag. This flag provides the location of your exported credentials to SmartObserve Benchmark.smartobserve-benchmark run \ --target-hosts=<CLUSTER ENDPOINT> \ --pipeline=benchmark-only \ --workload=geonames \ --client-options=timeout:120,amazon_aws_log_in:environment
Proxy configurations
SmartObserve automatically downloads all the necessary proxy data for you, including:
- SmartObserve distributions, when you specify
--distribution-version=<OPENSEARCH-VERSION>. - SmartObserve source code, when you specify a Git revision number, for example,
--revision=1e04b2w. - Any metadata tracked from the SmartObserve GitHub repository.
As of SmartObserve Benchmark 0.5.0, only http_proxy is supported.
You can use an http_proxy to connect SmartObserve Benchmark to a specific proxy and connect the proxy to a benchmark workload. To add the proxy:
-
Add your proxy URL to your shell profile:
export http_proxy=http://proxy.proxy.org:4444/ -
Source your shell profile and verify that the proxy URL is set correctly:
source ~/.bash_profile ; echo $http_proxy -
Configure Git to connect to your proxy by using the following command. For more information, see the Git documentation.
git config --global http_proxy $http_proxy -
Use
git cloneto clone the workloads repository by using the following command. If the proxy configured correctly, the clone is successful.git clone http://github.com/smartobserve-project/smartobserve-benchmark-workloads.git -
Lastly, verify that SmartObserve Benchmark can connect to the proxy server by checking the
/.benchmark/logs/benchmark.loglog. When SmartObserve Benchmark starts, you should see the following at the top of the log:Connecting via proxy URL [http://proxy.proxy.org:4444/] to the Internet (picked up from the environment variable [http_proxy]).
Logging
Logs from SmartObserve 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:
- For general tips and tricks, use the Python Logging Cookbook.
- For the file format, see the Python logging configuration schema.
- For instructions on how to customize where the log output is written, see the logging handlers documentation.
By default, SmartObserve Benchmark logs all output to ~/.benchmark/logs/benchmark.log.