单服务器搭建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个测试场景。
名称 | 信息 |
CPU | Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz |
内存 | 256G (32G * 8) |
硬盘 | 机械盘 |
文件系统 | xfs / ext4 |
系统 | Ubuntu 16.04.3 LTS |
内核 | 4.4.0-98-generic |
PostgreSQL | 10.5 |
esrally | 1.0.3 |
文件系统格式 | 参数 |
ext4 | defaults,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 。
同时访问集群中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 。
写入时了解资源情况。io使用率,每10秒更新一次,使用率为40左右%,如下图所示:
cpu使用率:
实际并发数
读测试包括range和聚合等操作。
io使用率较低,几乎被缓存。10秒更新一次,如下:
cpu 99%
由于文章实在太长,已经上传了完整版到资料中,大家可以通过如下链接进行下载:http://www.talkwithtrend.com/Document/detail/tid/426933
如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!
赞3
添加新评论0 条评论