Link Search Menu Expand Document Documentation Menu

OpenSearch 基准测试工作负载参考

工作负载是对一个或多个基准测试场景的规范。工作负载通常包括以下内容:

  • 一个或多个摄入到索引中的数据流
  • 作为基准测试一部分调用的查询和操作集

本节提供了在自定义或使用工作负载时可以使用的选项和示例列表。

有关工作负载组成部分的更多信息,请参阅工作负载的结构

工作负载示例

如果您想在创建自己的工作负载之前尝试某些工作负载,请使用以下示例。

无限制运行

在以下示例中,OpenSearch 基准测试对 movies 索引运行无限制的批量索引操作,持续 1 小时。

{
  "description": "Tutorial benchmark for OpenSearch Benchmark",
  "indices": [
    {
      "name": "movies",
      "body": "index.json"
    }
  ],
  "corpora": [
    {
      "name": "movies",
      "documents": [
        {
          "source-file": "movies-documents.json",
          "document-count": 11658903, # Fetch document count from command line
          "uncompressed-bytes": 1544799789 # Fetch uncompressed bytes from command line
        }
      ]
    }
  ],
  "schedule": [
  {
    "operation": "bulk",
    "warmup-time-period": 120,
    "time-period": 3600,
    "clients": 8
  }
]
}

单任务工作负载

以下工作负载运行一个单任务基准测试:一个 match_all 查询。由于没有指定 clients,因此只使用一个客户端。根据 schedule,工作负载以每秒 10 次操作的速度运行 match_all 查询,使用 1 个客户端,其中 100 次迭代用于预热,接下来的 100 次迭代用于测量基准。

{
  "description": "Tutorial benchmark for OpenSearch Benchmark",
  "indices": [
    {
      "name": "movies",
      "body": "index.json"
    }
  ],
  "corpora": [
    {
      "name": "movies",
      "documents": [
        {
          "source-file": "movies-documents.json",
          "document-count": 11658903, # Fetch document count from command line
          "uncompressed-bytes": 1544799789 # Fetch uncompressed bytes from command line
        }
      ]
    }
  ],
{
  "schedule": [
    {
      "operation": {
        "operation-type": "search",
        "index": "_all",
        "body": {
          "query": {
            "match_all": {}
          }
        }
      },
      "warmup-iterations": 100,
      "iterations": 100,
      "target-throughput": 10
    }
  ]
}
}

后续步骤


相关文章

剩余 350 字符

有问题?

想做贡献?