Skip to content

Commit 401c0ce

Browse files
authored
Update performance-testing-best-practices.md
Signed-off-by: Naarcha-AWS <[email protected]>
1 parent f4b530f commit 401c0ce

File tree

1 file changed

+23
-34
lines changed

1 file changed

+23
-34
lines changed

_benchmark/user-guide/optimizing-benchmarks/performance-testing-best-practices.md

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ Proper test configuration includes setting appropriate parameters for your test
3636
The following example shows a basic benchmark configuration file. This configuration includes essential parameters such as warmup time, test duration, and the number of clients:
3737

3838
```json
39-
{
40-
"name": "my-benchmark",
41-
"description": "Basic performance test",
42-
"test_procedures": [
43-
{
44-
"operation": {
45-
"warmup-time-period": 300,
46-
"time-period": 3600,
47-
"clients": 8
48-
}
39+
{
40+
"name": "my-benchmark-test-procedure",
41+
"description": "This test procedure runs term query against a cluster. It includes a 300-second warm-up, followed by a 3600-second benchmark using 8 concurrent clients.",
42+
"schedule": [
43+
{
44+
"operation": "term",
45+
"warmup-time=period": 300,
46+
"time-period": 3600,
47+
"clients": 8
48+
}
49+
]
4950
}
50-
]
51-
}
5251
```
52+
{% include copy.html %}
5353

5454
### Index settings
5555

@@ -83,6 +83,7 @@ opensearch-benchmark run \
8383
--report-format=csv \
8484
--report-file=benchmark-results.csv
8585
```
86+
{% include copy.html %}
8687

8788
### Monitoring during tests
8889

@@ -99,6 +100,7 @@ curl localhost:9200/_cat/indices?v
99100
# Monitor cluster health
100101
curl localhost:9200/_cluster/health?pretty
101102
```
103+
{% include copy.html %}
102104

103105
## Metrics collection
104106

@@ -120,6 +122,7 @@ Configure your benchmark to collect comprehensive metrics. The following configu
120122
}
121123
}
122124
```
125+
{% include copy.html %}
123126

124127
### Sample metrics to track
125128

@@ -144,14 +147,15 @@ metrics_to_track = {
144147
}
145148
}
146149
```
150+
{% include copy.html %}
147151

148152
### Metrics calculation
149153

150154
OpenSearch Benchmark calculates metrics differently from traditional client-server systems. For detailed information on how metrics are calculated, see [Differences between OpenSearch Benchmark and a traditional client server system](https://opensearch.org/docs/latest/benchmark/user-guide/concepts/#differences-between-opensearch-benchmark-and-a-traditional-client-server-system).
151155

152156
## Integration with OpenSearch Dashboards
153157

154-
To integrate OpenSearch Benchmark results with OpenSearch Dashboards, you can perform one of the following:
158+
To integrate OpenSearch Benchmark results with OpenSearch Dashboards, use the following steps:
155159

156160
1. [Configure OpenSearch Benchmark]({{site.url}}{{site.baseurl}}/benchmark/user-guide/install-and-configure/configuring-benchmark/) to store results in OpenSearch.
157161
2. Create index patterns in OpenSearch Dashboards for the benchmark results.
@@ -189,7 +193,7 @@ Proper documentation of your test environment is crucial for reproducibility and
189193

190194
Don't omit environment details from your test reports.
191195

192-
Instead, always document comprehensive details about your test environment. This should include hardware specifications, software versions, and any relevant configuration settings. as shown in the following example:
196+
Instead, always document comprehensive details about your test environment. This should include hardware specifications, software versions, and any relevant configuration settings. The following example shows how you can add environment details when running OpenSearch Benchmark with a Python script:
193197

194198
```python
195199
# DO: Document environment details
@@ -205,6 +209,7 @@ def run_benchmark():
205209
results = opensearch_benchmark.run()
206210
return {'environment': environment, 'results': results}
207211
```
212+
{% include copy.html %}
208213

209214
By documenting these details, you ensure that your test results can be properly interpreted and that the tests can be reproduced if necessary.
210215

@@ -226,11 +231,7 @@ By carefully reviewing these logs, you can often identify the root cause of perf
226231

227232
## Security considerations
228233

229-
Security should never be an afterthought in performance testing. It's important to include security configurations that match your production environment to get realistic performance measurements.
230-
231-
### SSL configuration
232-
233-
The following example of how to configure SSL in `opensearch.yml` for secure communications during benchmark testing:
234+
In most cases, a basic authentication protocol should work for testing. However, you can use SSL for secure communication during benchmark testing, as shown in the following example `opensearch.yml` configuration:
234235

235236
```yaml
236237
security:
@@ -241,20 +242,7 @@ security:
241242
client_certificate: /path/to/client.crt
242243
client_key: /path/to/client.key
243244
```
244-
245-
### Authentication setup
246-
247-
When testing with authentication enabled, ensure your benchmark includes the appropriate authentication headers:
248-
249-
```python
250-
headers = {
251-
'Authorization': 'Basic {}'.format(
252-
base64.b64encode(
253-
'{}:{}'.format(username, password).encode()
254-
).decode()
255-
)
256-
}
257-
```
245+
{% include copy.html %}
258246
259247
## Maintenance
260248
@@ -272,7 +260,8 @@ opensearch-benchmark update-workload geonames
272260
# Clean old data
273261
opensearch-benchmark clean
274262
```
263+
{% include copy.html %}
275264

276265
## Amazon OpenSearch Serverless considerations
277266

278-
When testing with Amazon OpenSearch Serverless, be aware that not all test procedures may be supported. Always check the README of the workload you're using to see if it's compatible with AOSS. If compatibility information is not provided, you may need to test the procedures individually to determine which ones are supported.
267+
When testing with Amazon OpenSearch Serverless, be aware that not all test procedures may be supported. Always check the README of the workload you're using to see if it's compatible with AOSS. If compatibility information is not provided, you may need to test the procedures individually to determine which ones are supported.

0 commit comments

Comments
 (0)