执行Esrally测试
- 修改“challenges/default.json”文件。
- 打开文件。
1
vi ~/.rally/benchmarks/tracks/default/geonames/challenges/default.json
由于测试中的default查询文档项目波动较大,测试前需要删除该项目。
- 按“i”进入编辑模式,删除文件中如下代码。
{ "operation": "default", "clients": 200, "warmup-iterations": 500, "iterations": 1000, "target-throughput": 7000 },
- 按“Esc”键,输入:wq!,按“Enter”保存并退出编辑。
- 打开文件。
- 修改“operations/default.json”文件。
- 打开文件。
1
vi ~/.rally/benchmarks/tracks/default/geonames/operations/default.json
- 按“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" } } } } } }
- term修改后如下。
- 按“Esc”键,输入:wq!,按“Enter”保存并退出编辑。
- 打开文件。
- 修改配置文件“~/.rally/benchmarks/tracks/default/geonames/challenges/default.json”中的各个用例的clients数和target-throughput数达到最佳性能。
- 打开配置文件。
1
vi ~/.rally/benchmarks/tracks/default/geonames/challenges/default.json
- 以term用例为例进行说明,按“i”进入编辑模式,修改配置文件如下所示。
{ "operation": "term", "clients": 200, "warmup-iterations": 500, "iterations": 1000, "target-throughput": 60000 },
- 按“Esc”键,输入:wq!,按“Enter”保存并退出编辑。
- 打开配置文件。
- 执行测试脚本。
1 2
cd esrally-test-tools/bin bin/run_test.sh