zhenda
作者zhenda·2019-07-30 10:42
数据库管理员·昆仑银行

ElasticSearch 单机基准测试

字数 1780阅读 10356评论 0赞 3

测试目的

单服务器搭建3节点的集群环境。本次测试在单机搭建elasticsearch集群下,重点关注多端口访问、shard数、副本数、jvm内存大小对批量写入和查询的性能影响。做为基准测试用于性能评估和功能(副本)取舍。

多端口访问定义:同时访问集群中3个节点端口(10.199.0.2:9300,10.199.0.2:9301,10.199.0.28:9302 ) 。

多端口压测命令:esrally --track=nyc_taxis --pipeline=benchmark-only --target-hosts=10.199.0.2:9300,10.199.0.2:9301,10.199.0.2:9302 --distribution-version=6.5.1 --offline

本测试共有7个测试场景。

压测机环境配置

名称信息
CPUIntel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz
内存256G (32G * 8)
硬盘机械盘
文件系统xfs / ext4
系统Ubuntu 16.04.3 LTS
内核4.4.0-98-generic
PostgreSQL10.5
esrally1.0.3

文件系统格式参数
ext4defaults,rw,noatime,nodiratime,nobarrier

压测工具为esrally,与 elasticsearch 数据库服务器分开部署,分别占用一台服务器。文档数165346692,索引大小27722564094(bytes),并发数设为50,bluk_size为10000。

压测参数设置

{

"operation": "index",

"warmup-time-period": 240,

{

"name": "refresh-after-index",

"operation": "refresh",

"clients": 50

},

{

"operation": "default",

"clients": 50,

"warmup-iterations": 50,

"iterations": 100,

"target-throughput": 50

},

{

"operation": "range",

"clients": 50,

"warmup-iterations": 50,

"iterations": 100,

"target-throughput": 50

},

{

"operation": "distance_amount_agg",

"clients": 50,

"warmup-iterations": 50,

"iterations": 100,

"target-throughput": 50

},

{

"operation": "autohisto_agg",

"clients": 50,

"warmup-iterations": 50,

"iterations": 100,

"target-throughput": 50

},

{

"operation": "date_histogram_agg",

"clients": 50,

"warmup-iterations": 50,

"iterations": 100,

"target-throughput": 50

}

查询 query 如下 :

为业务某 query 。

1 场景1(index.number_of_shards:1 index.number_of_replicas: 0,多端口)

同时访问集群中3个节点端口(10.199.0.188:9300,10.199.0.188:9301,10.199.0.188:9302 ),index.number_of_shards:1 、 index.number_of_replicas: 0 。

1.1 写入 (index)

写入时了解资源情况。io使用率,每10秒更新一次,使用率为40左右%,如下图所示:

cpu使用率:

实际并发数

1.2 查询

读测试包括range和聚合等操作。

io使用率较低,几乎被缓存。10秒更新一次,如下:

cpu 99%

由于文章实在太长,已经上传了完整版到资料中,大家可以通过如下链接进行下载:http://www.talkwithtrend.com/Document/detail/tid/426933

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

3

添加新评论0 条评论

Ctrl+Enter 发表

作者其他文章

相关文章

相关问题

相关资料

X社区推广