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]

最终给出测试结果: “

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

MetricValue
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

…….

——————————————————————————————————
更多ES相关实战干货经验分享,请扫描下方【铭毅天下】微信公众号二维码关注。
(每周至少更新一篇!)

这里写图片描述
和你一起,死磕Elasticsearch
——————————————————————————————————

作者:铭毅天下
转载请标明出处,原文地址:
http://blog.csdn.net/laoyang360/article/details/52176246
如果感觉本文对您有帮助,请点击‘顶’支持一下,您的支持是我坚持写作最大的动力,谢谢!

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 10
    评论
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

铭毅天下

和你一起,死磕Elastic!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值