鲲鹏社区首页
中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

执行Esrally测试

  1. 修改“challenges/default.json”文件。
    1. 打开文件。
      1
      vi ~/.rally/benchmarks/tracks/default/geonames/challenges/default.json
      

      由于测试中的default查询文档项目波动较大,测试前需要删除该项目。

    2. “i”进入编辑模式,删除文件中如下代码。
      {
           "operation": "default",
           "clients": 200,
            "warmup-iterations": 500,
            "iterations": 1000,
            "target-throughput": 7000
      },
    3. “Esc”键,输入:wq!,按“Enter”保存并退出编辑。
  2. 修改“operations/default.json”文件。
    1. 打开文件。
      1
      vi ~/.rally/benchmarks/tracks/default/geonames/operations/default.json
      
    2. “i”进入编辑模式,修改如下内容。

      由于官方默认的测试用例配置在term、phrase和country_agg_cached,3个用例下不能发挥鲲鹏处理器的最大性能,故对term、phrase的查询条件和country_agg_cached的查询size进行调整。

      • term修改后如下。
        {
              "name": "term",
              "operation-type": "search",
              "body": {
                "query": {
                  "term": {
                    "country_code": "us"
                  }
                }
              }
            },
      • phrase修改后如下所示。
        {
              "name": "phrase",
              "operation-type": "search",
              "body": {
                "query": {
                  "match_phrase": {
                    "country_code": "us"
                  }
                }
              }
            },
      • country_agg_cached修改后如下所示。
        {
              "name": "country_agg_cached",
              "operation-type": "search",
              "cache": true,
              "body": {
                "size": 1000,
                "aggs": {
                  "country_population": {
                    "terms": {
                      "field": "country_code"
                    },
                    "aggs": {
                      "sum_population": {
                        "sum": {
                          "field": "population"
                        }
                      }
                    }
                  }
                }
              }
    3. “Esc”键,输入:wq!,按“Enter”保存并退出编辑。
  3. 修改配置文件“~/.rally/benchmarks/tracks/default/geonames/challenges/default.json”中的各个用例的clients数和target-throughput数达到最佳性能。
    1. 打开配置文件。
      1
      vi ~/.rally/benchmarks/tracks/default/geonames/challenges/default.json
      
    2. 以term用例为例进行说明,按“i”进入编辑模式,修改配置文件如下所示。
      { 
          "operation": "term", 
          "clients": 200, 
          "warmup-iterations": 500, 
          "iterations": 1000, 
          "target-throughput": 60000
      }, 
    3. “Esc”键,输入:wq!,按“Enter”保存并退出编辑。
  4. 执行测试脚本。
    1
    2
    cd esrally-test-tools/bin
    bin/run_test.sh