OpenSearch Benchmark quickstart
출처: 문서
본문
OpenSearch Benchmark 퀵스타트
이 페이지에서는 OpenSearch Benchmark를 빠르게 설치하고 첫 번째 OpenSearch Benchmark 워크로드를 실행하는 방법을 안내해요.
사전 준비 사항
퀵스타트 단계를 수행하려면 다음과 같은 사전 준비 사항을 충족해야 해요:
- 현재 활성 상태인 OpenSearch 클러스터. OpenSearch 클러스터를 생성하는 방법은 클러스터 생성하기를 참고하세요.
- Git 2.3 이상.
- Python 3.8 이상
OpenSearch 클러스터 설정하기
아직 활성화된 OpenSearch 클러스터가 없다면, OpenSearch Benchmark와 함께 사용할 새 OpenSearch 클러스터를 시작할 수 있어요.
- Docker Compose 사용. Docker Compose 사용 방법은 OpenSearch 퀵스타트를 참고하세요.
- Tar 사용. Tar로 OpenSearch를 설치하는 방법은 OpenSearch 설치 > Tarball을 참고하세요.
OpenSearch Benchmark는 Windows 배포판의 OpenSearch에서 테스트되지 않았어요. {: .note}
설치 후에는 localhost:9200에 접속해서 OpenSearch가 실행 중인지 확인할 수 있어요. Security 플러그인을 활성화한 상태로 클러스터를 실행한다면, OpenSearch는 사용자 이름 "admin"과 비밀번호 "admin"으로 SSL 연결을 기대해요. 하지만 localhost 주소는 고유한 공개 주소가 아니기 때문에 어떤 인증 기관도 이를 위한 SSL 인증서를 발급하지 않아요. 그래서 -k 옵션을 사용해 인증서 검사를 비활성화해야 해요.
다음 명령어를 사용해 SSL 인증서 검사를 비활성화한 상태에서 OpenSearch가 실행 중인지 확인해 보세요:
curl -k -u admin:<custom-admin-password> https://localhost:9200 # the "-k" option skips SSL certificate checks
{
"name" : "147ddae31bf8.opensearch.org",
"cluster_name" : "opensearch",
"cluster_uuid" : "n10q2RirTIuhEJCiKMkpzw",
"version" : {
"distribution" : "opensearch",
"number" : "2.10.0",
"build_type" : "tar",
"build_hash" : "eee49cb340edc6c4d489bcd9324dda571fc8dc03",
"build_date" : "2023-09-20T23:54:29.889267151Z",
"build_snapshot" : false,
"lucene_version" : "9.7.0",
"minimum_wire_compatibility_version" : "7.10.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "The OpenSearch Project: https://opensearch.org/"
}
클러스터가 실행되고 있으니, 이제 OpenSearch Benchmark를 설치할 수 있어요.
OpenSearch Benchmark 설치하기
Docker로 OpenSearch Benchmark를 설치하려면 OpenSearch Benchmark 설치 > Docker를 사용한 설치를 참고하세요. {: .tip}
PyPi에서 OpenSearch Benchmark를 설치하려면 다음 pip 명령어를 입력하세요:
pip3 install opensearch-benchmark
{% include copy.html %}
설치가 완료되면 다음 명령어를 입력해서 OpenSearch Benchmark가 실행 중인지 확인해 보세요:
opensearch-benchmark --help
성공하면 OpenSearch가 다음과 같은 응답을 반환해요:
$ opensearch-benchmark --help
usage: opensearch-benchmark [-h] [--version] {run,list,info,create-workload,generate,compare,download,install,start,stop} ...
____ _____ __ ____ __ __
/ __ \____ ___ ____ / ___/___ ____ ___________/ /_ / __ )___ ____ _____/ /_ ____ ___ ____ ______/ /__
/ / / / __ \/ _ \/ __ \\__ \/ _ \/ __ `/ ___/ ___/ __ \ / __ / _ \/ __ \/ ___/ __ \/ __ `__ \/ __ `/ ___/ //_/
/ /_/ / /_/ / __/ / / /__/ / __/ /_/ / / / /__/ / / / / /_/ / __/ / / / /__/ / / / / / / / / /_/ / / / ,<
\____/ .___/\___/_/ /_/____/\___/\__,_/_/ \___/_/ /_/ /_____/\___/_/ /_/\___/_/ /_/_/ /_/ /_/\__,_/_/ /_/|_|
/_/
A benchmarking tool for OpenSearch
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
subcommands:
{run,list,info,create-workload,generate,compare,download,install,start,stop}
run Run a benchmark
list List configuration options
info Show info about a workload
create-workload Create a Benchmark workload from existing data
generate Generate artifacts
compare Compare two test-runs
download Downloads an artifact
install Installs an OpenSearch node locally
start Starts an OpenSearch node locally
stop Stops an OpenSearch node locally
Find out more about Benchmark at https://opensearch.org/docs
첫 번째 벤치마크 실행하기
이제 첫 번째 벤치마크를 실행할 수 있어요. 다음 벤치마크는 percolator 워크로드를 사용해요.
워크로드 명령어 플래그 이해하기
벤치마크는 run 명령어에 다음 명령어 플래그를 사용해 실행해요:
추가적인 run 명령어 플래그는 run 레퍼런스를 참고하세요. 자주 사용되는 옵션으로는 --workload-params, --exclude-tasks, --include-tasks가 있어요.
{: .tip}
--pipeline=benchmark-only: 사용자가 자신의 OpenSearch 클러스터를 직접 제공하겠다는 것을 OSB에 알려줘요.
workload=percolator: OpenSearch Benchmark가 사용하는 워크로드의 이름이에요.
--target-host="<OpenSearch Cluster Endpoint>": 벤치마크를 수행할 대상 클러스터나 호스트를 나타내요. 여기에 OpenSearch 클러스터의 엔드포인트를 입력하세요.--client-options="basic_auth_user:'<Basic Auth Username>',basic_auth_password:'<Basic Auth Password>'": OpenSearch 클러스터의 사용자 이름과 비밀번호예요.--test-mode: 워크로드를 전체 기간에 걸쳐 실행하지 않고도 실행할 수 있게 해줘요. 이 플래그가 있으면 Benchmark가 워크로드 내 각 작업의 첫 1,000개 연산을 실행해요. 이는 동작 확인용으로만 사용되는 것이며, 생성되는 지표는 의미가 없어요.--distribution-version: 프로비저닝 시 Benchmark가 사용할 OpenSearch 버전을 나타내요. 실행하면run명령어가 OpenSearch 클러스터에 연결할 때 올바른 배포 버전을 파싱해요.
워크로드 실행하기
OpenSearch Benchmark로 percolator 워크로드를 실행하려면 다음 run 명령어를 사용하세요:
opensearch-benchmark run --pipeline=benchmark-only --workload=percolator --target-host=https://localhost:9200 --client-options=basic_auth_user:admin,basic_auth_password:admin,verify_certs:false --test-mode
{% include copy.html %}
run 명령어가 실행되면 percolator 워크로드의 모든 작업과 연산이 순차적으로 실행돼요.
테스트 검증하기
OpenSearch Benchmark 테스트가 실행된 후에는 다음 단계를 따라 제대로 실행되었는지 확인해 보세요:
- 벤치마크를 실행하려는 OpenSearch 또는 OpenSearch Dashboards 인덱스의 문서 수를 확인해 두세요.
- OpenSearch Benchmark가 반환한 결과에서 해당 워크로드의
workload.json파일과 비교해 문서 수가 일치하는지 확인해 보세요. 예를 들어 percolator의workload.json파일을 기준으로 하면, 클러스터에2000000개의 문서가 있을 것으로 예상할 수 있어요.
결과 이해하기
벤치마크가 완료되면 OpenSearch Benchmark가 다음과 같은 응답을 반환해요:
------------------------------------------------------
_______ __ _____
/ ____(_)___ ____ _/ / / ___/_________ ________
/ /_ / / __ \/ __ `/ / \__ \/ ___/ __ \/ ___/ _ \
/ __/ / / / / / /_/ / / ___/ / /__/ /_/ / / / __/
/_/ /_/_/ /_/\__,_/_/ /____/\___/\____/_/ \___/
------------------------------------------------------
| Metric | Task | Value | Unit |
|---------------------------------------------------------------:|-------------------------------------------:|------------:|-------:|
| Cumulative indexing time of primary shards | | 0.02655 | min |
| Min cumulative indexing time across primary shards | | 0 | min |
| Median cumulative indexing time across primary shards | | 0.00176667 | min |
| Max cumulative indexing time across primary shards | | 0.0140333 | min |
| Cumulative indexing throttle time of primary shards | | 0 | min |
| Min cumulative indexing throttle time across primary shards | | 0 | min |
| Median cumulative indexing throttle time across primary shards | | 0 | min |
| Max cumulative indexing throttle time across primary shards | | 0 | min |
| Cumulative merge time of primary shards | | 0.0102333 | min |
| Cumulative merge count of primary shards | | 3 | |
| Min cumulative merge time across primary shards | | 0 | min |
| Median cumulative merge time across primary shards | | 0 | min |
| Max cumulative merge time across primary shards | | 0.0102333 | min |
| Cumulative merge throttle time of primary shards | | 0 | min |
| Min cumulative merge throttle time across primary shards | | 0 | min |
| Median cumulative merge throttle time across primary shards | | 0 | min |
| Max cumulative merge throttle time across primary shards | | 0 | min |
| Cumulative refresh time of primary shards | | 0.0709333 | min |
| Cumulative refresh count of primary shards | | 118 | |
| Min cumulative refresh time across primary shards | | 0 | min |
| Median cumulative refresh time across primary shards | | 0.00186667 | min |
| Max cumulative refresh time across primary shards | | 0.0511667 | min |
| Cumulative flush time of primary shards | | 0.00963333 | min |
| Cumulative flush count of primary shards | | 4 | |
| Min cumulative flush time across primary shards | | 0 | min |
| Median cumulative flush time across primary shards | | 0 | min |
| Max cumulative flush time across primary shards | | 0.00398333 | min |
| Total Young Gen GC time | | 0 | s |
| Total Young Gen GC count | | 0 | |
| Total Old Gen GC time | | 0 | s |
| Total Old Gen GC count | | 0 | |
| Store size | | 0.000485923 | GB |
| Translog size | | 2.01873e-05 | GB |
| Heap used for segments | | 0 | MB |
| Heap used for doc values | | 0 | MB |
| Heap used for terms | | 0 | MB |
| Heap used for norms | | 0 | MB |
| Heap used for points | | 0 | MB |
| Heap used for stored fields | | 0 | MB |
| Segment count | | 32 | |
| Min Throughput | index | 3008.97 | docs/s |
| Mean Throughput | index | 3008.97 | docs/s |
| Median Throughput | index | 3008.97 | docs/s |
| Max Throughput | index | 3008.97 | docs/s |
| 50th percentile latency | index | 351.059 | ms |
| 100th percentile latency | index | 365.058 | ms |
| 50th percentile service time | index | 351.059 | ms |
| 100th percentile service time | index | 365.058 | ms |
| error rate | index | 0 | % |
| Min Throughput | wait-until-merges-finish | 28.41 | ops/s |
| Mean Throughput | wait-until-merges-finish | 28.41 | ops/s |
| Median Throughput | wait-until-merges-finish | 28.41 | ops/s |
| Max Throughput | wait-until-merges-finish | 28.41 | ops/s |
| 100th percentile latency | wait-until-merges-finish | 34.7088 | ms |
| 100th percentile service time | wait-until-merges-finish | 34.7088 | ms |
| error rate | wait-until-merges-finish | 0 | % |
| Min Throughput | percolator_with_content_president_bush | 36.09 | ops/s |
| Mean Throughput | percolator_with_content_president_bush | 36.09 | ops/s |
| Median Throughput | percolator_with_content_president_bush | 36.09 | ops/s |
| Max Throughput | percolator_with_content_president_bush | 36.09 | ops/s |
| 100th percentile latency | percolator_with_content_president_bush | 35.9822 | ms |
| 100th percentile service time | percolator_with_content_president_bush | 7.93048 | ms |
| error rate | percolator_with_content_president_bush | 0 | % |
[...]
| Min Throughput | percolator_with_content_ignore_me | 16.1 | ops/s |
| Mean Throughput | percolator_with_content_ignore_me | 16.1 | ops/s |
| Median Throughput | percolator_with_content_ignore_me | 16.1 | ops/s |
| Max Throughput | percolator_with_content_ignore_me | 16.1 | ops/s |
| 100th percentile latency | percolator_with_content_ignore_me | 131.798 | ms |
| 100th percentile service time | percolator_with_content_ignore_me | 69.5237 | ms |
| error rate | percolator_with_content_ignore_me | 0 | % |
| Min Throughput | percolator_no_score_with_content_ignore_me | 29.37 | ops/s |
| Mean Throughput | percolator_no_score_with_content_ignore_me | 29.37 | ops/s |
| Median Throughput | percolator_no_score_with_content_ignore_me | 29.37 | ops/s |
| Max Throughput | percolator_no_score_with_content_ignore_me | 29.37 | ops/s |
| 100th percentile latency | percolator_no_score_with_content_ignore_me | 45.5703 | ms |
| 100th percentile service time | percolator_no_score_with_content_ignore_me | 11.316 | ms |
| error rate | percolator_no_score_with_content_ignore_me | 0 | % |
-----------------------------------
[INFO] ✅ SUCCESS (took 18 seconds)
-----------------------------------
percolator 워크로드가 실행하는 각 작업은 테스트 실행 시 수행된 특정 OpenSearch API 연산(예: Bulk 또는 Search)을 나타내요. 출력 요약의 각 작업에는 다음 정보가 포함되어 있어요:
- 처리량: 초당 성공한 OpenSearch 연산 수예요.
- 지연 시간: 대기 시간을 포함해서, 요청과 응답이 Benchmark에 의해 전송되고 수신되기까지 걸린 시간이에요.
- 서비스 시간: 대기 시간을 제외하고, 요청과 응답이 Benchmark에 의해 전송되고 수신되기까지 걸린 시간이에요.
- 오류율: 작업 중에 실행된 연산 중 성공하지 못했거나 200 오류 코드를 반환한 연산의 비율이에요.
요약 보고서가 생성되는 방식에 대한 자세한 내용은 요약 보고서를 참고하세요.
자체 클러스터에서 OpenSearch Benchmark 실행하기
이제 클러스터에서 OpenSearch Benchmark를 실행하는 방법에 익숙해졌으니, 동일한 run 명령어를 사용하되 다음 설정을 바꿔서 자체 클러스터에서 OpenSearch Benchmark를 실행할 수 있어요:
https://localhost:9200을 대상 클러스터의 엔드포인트로 바꾸세요.https://search.mydomain.com같은 URI나HOST:PORT형식을 사용할 수 있어요.- 클러스터가 기본 인증으로 구성되어 있다면, 명령줄의 사용자 이름과 비밀번호를 알맞은 자격 증명으로 바꾸세요.
localhost를 대상 클러스터로 지정하지 않는다면verify_certs:false지시어를 제거하세요. 이 지시어는 SSL 인증서가 설정되지 않은 클러스터에만 필요해요.HOST:PORT형식을 사용하면서 SSL/TLS를 사용할 계획이라면https://를 지정하거나--client-options문자열 옵션에use_ssl:true지시어를 추가하세요.- 축소된 테스트 대신 전체 워크로드를 실행하려면
--test-mode플래그를 제거하세요.
다음 명령어 템플릿을 복사해서 자체 터미널에서 사용할 수 있어요:
opensearch-benchmark run --pipeline=benchmark-only --workload=percolator --target-host=<OpenSearch Cluster Endpoint> --client-options=basic_auth_user:admin,basic_auth_password:admin
{% include copy.html %}
다음 단계
OpenSearch Benchmark에 대해 더 자세히 알아보려면 다음 리소스를 참고하세요:
- 사용자 가이드: OpenSearch Benchmark가 클러스터 성능 추적에 어떻게 도움을 줄 수 있는지 자세히 살펴보세요.
- 튜토리얼: 단계별 가이드를 활용해 더 고급 벤치마킹 구성과 기능을 확인해 보세요.