ES的一些优化经验

亿级规模的ES查询优化实战

  • 能用filter就不用query
    filter拿到相应的doc后不计算score不用排序
    query会对符合条件的doc计算score并进行排序
    filter的查询速度比query快很多

  • 增加相关cache的配置
    indices.cache.filter.size: 30%
    indices.fielddata.cache.size: 60%
    index.cache.field.type: soft
    indices.breaker.fielddata.limit: 70%

  • 优化方案——总结
    能用filter就不用query
    增加冗余字段将部分range aggregation查询变成terms aggregation
    为常用字段增加配置,将fielddata的loading设成eager,尽量多加载到内存
    增加集群的缓存资源,把内存尽量多的用起来
    Global ordinals
    Index warmer
    调整aggregation的collect_mode
    上SSD

elasticsearch一些使用经验以及优化方法

  • Elasticsearch索引速度优化
    index.refresh_interval :-1
    index.number_of_shards : X
    index.number_of_replicas : 0
    index.translog.sync_interval : 30s
    index.translog.durability : “async”
    index.translog.flush_threshold_size: 4g
    index.translog.flush_threshold_ops: 50000

  • 其它
    去掉_all字段可节省一半空间
    开启索引压缩可节省空间,但会有10%-20%的性能损耗
    不需分词的字符串字段设成not_analyzed

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值