본문 바로가기
WIKI 기술 지식 베이스

Running a workload

원문 보기 위키 갱신

출처: 문서

본문

워크로드 실행하기

OpenSearch Benchmark 워크로드의 다양한 구성 요소를 완전히 이해했다면, 첫 번째 워크로드를 실행할 수 있어요.

1단계: 워크로드 이름 찾기

OpenSearch Benchmark에 포함된 표준 워크로드에 대해 자세히 알아보려면 다음 명령어를 사용하세요:

opensearch-benchmark list workloads

{% include copy.html %}

OpenSearch Benchmark가 지원하는 모든 워크로드 목록이 나타나요. 목록을 살펴보고 클러스터의 사용 사례와 가장 유사한 워크로드를 선택하세요.

2단계: 테스트 실행하기

워크로드를 선택했다면 opensearch-benchmark run 명령어로 워크로드를 실행할 수 있어요. --target-host는 클러스터의 host:port 쌍으로 바꾸고, --client-options는 클러스터 접근에 필요한 인증 옵션으로 바꾸세요. 다음 예제는 테스트 목적으로 localhost에서 nyc_taxis 워크로드를 실행해요.

외부 클러스터에서 테스트를 실행하려면 자신의 클러스터에서 워크로드 실행하기를 참고하세요.

opensearch-benchmark run --pipeline=benchmark-only --workload=nyc_taxis --target-host=https://localhost:9200 --client-options=basic_auth_user:admin,basic_auth_password:admin,verify_certs:false

{% include copy.html %}

테스트 결과는 run 명령어에서 --output-path 옵션으로 설정한 디렉터리에 나타나요.

테스트 모드

워크로드가 의도한 대로 동작하는지 확인하기 위해 테스트를 테스트 모드로 실행하고 싶다면, run 명령어에 --test-mode 옵션을 추가하세요. 테스트 모드에서는 제공된 각 인덱스의 처음 1,000개 문서만 색인하고, 해당 문서들을 대상으로 쿼리 연산을 실행해요.

--workload-params 사용하기

--workload-params 옵션으로 워크로드별 파라미터를 전달하면 워크로드의 동작을 커스터마이즈할 수 있어요. 이 플래그는 쉼표로 구분된 키-값 쌍 목록을 받으며, 워크로드의 workload.json 파일에 정의된 기본값을 재정의해요.

예를 들어 어떤 워크로드에서는 인덱싱할 문서 수, 쿼리 실행에 사용할 클라이언트 수, 인덱스 이름을 설정할 수 있어요. 이런 파라미터는 특정 사용 사례나 인프라 제약 조건에 맞게 벤치마크를 조정하는 데 중요한 역할을 할 수 있어요.

워크로드 파라미터를 전달하려면 다음 문법을 사용하세요:

--workload-params="number_of_documents:100000,index_name:custom-index"

다음 예제에서처럼 이 옵션을 run 명령어에 추가하세요:

opensearch-benchmark run \
--pipeline=benchmark-only \
--workload=nyc_taxis \
--target-host=https://localhost:9200 \
--client-options=basic_auth_user:admin,basic_auth_password:admin,verify_certs:false \
--workload-params="bulk_size:500,index_name:nyc_custom"

사용 가능한 워크로드 파라미터는 OpenSearch Benchmark Workloads GitHub repository에서 각 워크로드의 README를 통해 확인할 수 있어요. {: .tip}

3단계: 테스트 검증하기

OpenSearch Benchmark 테스트를 실행한 후에는 다음 단계를 따라 테스트가 제대로 실행됐는지 확인하세요:

  1. 벤치마크를 실행하려는 OpenSearch 또는 OpenSearch Dashboards 인덱스의 문서 수를 기록해 두세요.
  2. OpenSearch Benchmark가 반환한 결과에서 해당 워크로드의 workload.json 파일과 비교해 문서 수가 일치하는지 확인하세요. 예를 들어 nyc_taxis의 workload.json 파일을 기준으로 하면 클러스터에 165346692개의 문서가 있을 것으로 예상할 수 있어요.

예상 결과

벤치마크가 완료되면 OSB는 다음과 같은 응답을 반환해요:

------------------------------------------------------
    _______             __   _____
   / ____(_)___  ____ _/ /  / ___/_________  ________
  / /_  / / __ \/ __ `/ /   \__ \/ ___/ __ \/ ___/ _ \
 / __/ / / / / / /_/ / /   ___/ / /__/ /_/ / /  /  __/
/_/   /_/_/ /_/\__,_/_/   /____/\___/\____/_/   \___/
------------------------------------------------------

|                                                         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)
-----------------------------------

외부 클러스터에서 워크로드 실행하기

로컬 클러스터에서 OpenSearch Benchmark를 실행하는 방법이 익숙해졌다면, 다음 단계에 따라 외부 클러스터에서도 실행할 수 있어요:

  1. https://localhost:9200을 대상 클러스터 엔드포인트로 바꾸세요. 엔드포인트는 https://search.mydomain.com처럼 URI(Uniform Resource Identifier)일 수도 있고 HOST:PORT 형식일 수도 있어요.
  2. 클러스터에 기본 인증이 설정되어 있다면 명령줄의 사용자 이름과 비밀번호를 적절한 자격 증명으로 바꾸세요.
  3. 대상 클러스터로 localhost를 지정하지 않는다면 verify_certs:false 지시자를 제거하세요. 이 지시자는 SSL 인증서가 없는 클러스터에만 필요해요.
  4. HOST:PORT 형식을 사용하면서 SSL이나 TLS를 사용하려면 https://를 지정하거나 --client-options 문자열 옵션에 use_ssl:true 지시자를 추가하세요.
  5. 축약된 테스트가 아니라 전체 워크로드를 실행하려면 --test-mode 플래그를 제거하세요.

다음 명령어 템플릿을 복사해서 자신의 터미널에서 사용할 수 있어요:

opensearch-benchmark run --pipeline=benchmark-only --workload=nyc_taxis --target-host=<OpenSearch Cluster Endpoint> --client-options=basic_auth_user:admin,basic_auth_password:admin

{% include copy.html %}

더 알아보기 (Learn more)