天天看点

esrally性能测试原理

1. 前提

esrally的运行不会影响当前系统elasticsearch的一切正常业务。

2. 性能测试原理

大致步骤概括如下:

第一步:安装esrally,耗时会半小时到1个小时之间。

主要完成esrally必要组件安装,更多的是elasticsearch的安装。

elasticsearch安装的两种方式:

方式一:最常用的安装方法,源码安装。只需要运行esrally,等价于运行:
esrally race --pipeline=from-sources-complete --revision=current --track=geonames --challenge=append-no-conflicts --car=defaults           
方式二:指定elasticsearch版本进行安装, 如下所示:

esrally –pipline=from-distribution –distribution-version=2.3.4,

Rally 将从以下官网链接下载 elasticsearch2.3.4

https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.3.4/elasticsearch-2.3.4.tar.gz

至此,esrally安装成功,对应的elaticsearch安装成功。

第二步:全面的测试。

从日志可以查看结果,日志最终存储文件为:

/home/elasticsearch/.rally/benchmarks/races/2016-08-10-06-50-06/local/logs-geonames-append-no-conflicts-defaults.zip

可以查看到如下信息,我们能看到PUT/POST/GET/DELETE/HEAD等操作。

每条测试都记录了状态status,请求时间request。

2016-08-10 06:52:30,221 elasticsearch INFO GET http://localhost:39200/_cluster/health?wait_for_status=green&timeout=3s&wait_for_relocating_shards=0 [status:20        0 request:0.011s]

......           

2016-08-10 06:52:34,674 elasticsearch INFO POST

http://localhost:39200/_bulk

[status:200 request:4.264s]

……

2016-08-10 07:04:11,309 elasticsearch INFO GET

http://localhost:39200/geonames/_stats/_all?level=shards

[status:200 request:0.027s]

2016-08-10 07:16:18,219 elasticsearch INFO DELETE

http://localhost:39200/_search/scroll/DnF1ZXJ5VGhlbkZldGNoBQAAAAAAACDMFlotSVZXOUkzUWFpTFFGWEVEZzhxcncAAAAAAAAgzhZaLUlW

VzlJM1FhaUxRRlhFRGc4cXJ3AAAAAAAAIM8WWi1JVlc5STNRYWlMUUZYRURnOHFydwAAAAAAACDQFlotSVZXOUkzUWFpTFFGWEVEZzhxcncAAAAAAAAgzRZaLUlWVzlJM1FhaUxRRlhFRGc4cXJ3 [status:200 request :0.002s]

第三步:统计、给出最终结果。 esrally会运行较长时间,完成如下几类测试操作:

Racing on track [geonames] and challenge [append-no-conflicts] with car [defaults] Benchmarking indexing at 12590.4 docs/s [100% done]

Benchmarking stats (warmup iteration 100/100) [100% done] Benchmarking stats (iteration 100/100) [100% done] Benchmarking search (warmup iteration 100/100) [100% done] Benchmarking search (iteration 100/100) [100% done]

最终给出测试结果:

esrally性能测试原理
Metric Value
Min Indexing Throughput [docs/s] 12410
Median Indexing Throughput [docs/s] 12675.2
Max Indexing Throughput [docs/s] 13567
Indexing time [min] 158.259
Merge time [min] 29.5808
Refresh time [min] 8.4305
Flush time [min] 2.11967
Merge throttle time [min] 1.16355

Metric Value

Min Indexing Throughput [docs/s] 12410

Median Indexing Throughput [docs/s] 12675.2

Max Indexing Throughput [docs/s] 13567

Indexing time [min] 158.259

Merge time [min] 29.5808

Refresh time [min] 8.4305

Flush time [min] 2.11967

Merge throttle time [min] 1.16355

…….

作者:铭毅天下

转载请标明出处,原文地址:

http://blog.csdn.net/laoyang360/article/details/52176246