elasticsearch aggregations_elasticsearch性能场景及优化技巧

9046397d0215094f7c3884a02cc944df.png

常见情形

  1. 没有大量查询时资源负载都很高 这种情况通常是有太多shards,常驻内存的数据超过单个实例heap的容量,发生内存及磁盘交换。 建议措施:设计上需要进行容量规划,确认合理的实例数及实例配置,区分冷热数据,清理关闭不会用于查询的索引。
  2. elasticsearch线程池rejected指标过高 这种情况通常是查询请求遇到阻塞,以至于超出线程池max_size,请求被搁置到查询队列等待。阻塞原因很有可能是(分片数过多)网络io,以及磁盘io 建议措施:创建索引时,确定合理分片数,除此以外,可以观察Task Management API,确认较慢的任务及可能原因。
  3. 高CPU及indexing频繁 建议措施:可以降低index频率(index.refresh_ interval),甚至对于一些业务数据,可以disable indexing。

关键指标

  • CPU load
  • Indexing throughput
  • Search throughput
  • Garbage collection (GC) activity
  • Search thread pool queue sizes

调优工具

Profile API | Elasticsearch Reference [7.0] | Elastic​www.elastic.co
c8b4ddc2fe785083c5842570acf9225e.png
Slow Log | Elasticsearch Reference [7.0] | Elastic​www.elastic.co
c8b4ddc2fe785083c5842570acf9225e.png

参考 https://www.elastic.co/cn/blog/advanced-tuning-finding-and-fixing-slow-elasticsearch-queries https://www.elastic.co/cn/blog/improving-the-performance-of-high-cardinality-terms-aggregations-in-elasticsearch Tune for search speed

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值