elasticsearch 调优

elasticsearch 调优,第1张

elasticsearch 调优 elasticsearch 调优

1、 内存占比很高,硬盘占比较高,降低内存和硬盘占比情况

2、 在elastic search application.yml增加配置,关闭 Swap

bootstrap.mlockall: true

3、数据压缩传输配置
http.compression: true
http.compression_level: 1

4、Nlp 和Elasticsearch 中的http使用连接池和keep alive
5、不需要传的字段不要传,尽量从es获取数据,不要从多个接口获取数据
6、修改刷新频率
PUT michaels_product/_settings
{
“index.refresh_interval” : “30s”

}
7、内存配置要机器内存的一半
8、避免日志数据无限的增长,只保留5天日志,zplin的数据信息独立分开到别的服务器
9、降低内存使用的占比,最好要在75%以内,避免响应时间慢

10、读写分离、一个节点读,另一个节点写

11、关闭大量的轮询更新,部分轮询更新改为pub/sub增量更新

12、对索引进行translog的优化。

PUT /michaels_projects/_settings
{

“index” : {
“refresh_interval” : “60s”,
“translog” : {
“generation_threshold_size” : “64mb”,
“flush_threshold_size” : “1024mb”,
“sync_interval” : “60s”,
“durability” : “async”
},
“merge” : {
“scheduler” : {
“max_thread_count” : “1”
},
“policy” : {
“segments_per_tier” : “30”
}
}
}

}

PUT /michaels_events/_settings
{

“index” : {
“refresh_interval” : “60s”,
“translog” : {
“generation_threshold_size” : “64mb”,
“flush_threshold_size” : “1024mb”,
“sync_interval” : “60s”,
“durability” : “async”
},
“merge” : {
“scheduler” : {
“max_thread_count” : “1”
},
“policy” : {
“segments_per_tier” : “30”
}
}
}

}

PUT /michaels_product/_settings
{

“index” : {
“refresh_interval” : “60s”,
“translog” : {
“generation_threshold_size” : “64mb”,
“flush_threshold_size” : “1024mb”,
“sync_interval” : “60s”,
“durability” : “async”
},
“merge” : {
“scheduler” : {
“max_thread_count” : “1”
},
“policy” : {
“segments_per_tier” : “30”
}
}
}

}

PUT /michaels_browsing_history/_settings
{

“index” : {
“refresh_interval” : “60s”,
“translog” : {
“generation_threshold_size” : “64mb”,
“flush_threshold_size” : “1024mb”,
“sync_interval” : “60s”,
“durability” : “async”
},
“merge” : {
“scheduler” : {
“max_thread_count” : “1”
},
“policy” : {
“segments_per_tier” : “30”
}
}
}

}

PUT /michaels_category/_settings
{

“index” : {
“refresh_interval” : “60s”,
“translog” : {
“generation_threshold_size” : “64mb”,
“flush_threshold_size” : “1024mb”,
“sync_interval” : “60s”,
“durability” : “async”
},
“merge” : {
“scheduler” : {
“max_thread_count” : “1”
},
“policy” : {
“segments_per_tier” : “30”
}
}
}

}

PUT /michaels_promotion/_settings
{

“index” : {
“refresh_interval” : “60s”,
“translog” : {
“generation_threshold_size” : “64mb”,
“flush_threshold_size” : “1024mb”,
“sync_interval” : “60s”,
“durability” : “async”
},
“merge” : {
“scheduler” : {
“max_thread_count” : “1”
},
“policy” : {
“segments_per_tier” : “30”
}
}
}

}

PUT /marketplace_makers/_settings
{

“index” : {
“refresh_interval” : “60s”,
“translog” : {
“generation_threshold_size” : “64mb”,
“flush_threshold_size” : “1024mb”,
“sync_interval” : “60s”,
“durability” : “async”
},
“merge” : {
“scheduler” : {
“max_thread_count” : “1”
},
“policy” : {
“segments_per_tier” : “30”
}
}
}

}

PUT /marketplace_product/_settings
{

“index” : {
“refresh_interval” : “60s”,
“translog” : {
“generation_threshold_size” : “64mb”,
“flush_threshold_size” : “1024mb”,
“sync_interval” : “60s”,
“durability” : “async”
},
“merge” : {
“scheduler” : {
“max_thread_count” : “1”
},
“policy” : {
“segments_per_tier” : “30”
}
}
}

}

PUT /product_autocompletion/_settings
{

“index” : {
“refresh_interval” : “60s”,
“translog” : {
“generation_threshold_size” : “64mb”,
“flush_threshold_size” : “1024mb”,
“sync_interval” : “60s”,
“durability” : “async”
},
“merge” : {
“scheduler” : {
“max_thread_count” : “1”
},
“policy” : {
“segments_per_tier” : “30”
}
}
}

}

PUT /order_history/_settings
{

“index” : {
“refresh_interval” : “60s”,
“translog” : {
“generation_threshold_size” : “64mb”,
“flush_threshold_size” : “1024mb”,
“sync_interval” : “60s”,
“durability” : “async”
},
“merge” : {
“scheduler” : {
“max_thread_count” : “1”
},
“policy” : {
“segments_per_tier” : “30”
}
}
}

}

PUT /return_order_history/_settings
{

“index” : {
“refresh_interval” : “60s”,
“translog” : {
“generation_threshold_size” : “64mb”,
“flush_threshold_size” : “1024mb”,
“sync_interval” : “60s”,
“durability” : “async”
},
“merge” : {
“scheduler” : {
“max_thread_count” : “1”
},
“policy” : {
“segments_per_tier” : “30”
}
}
}

}

PUT /event_autocompletion/_settings
{

“index” : {
“refresh_interval” : “60s”,
“translog” : {
“generation_threshold_size” : “64mb”,
“flush_threshold_size” : “1024mb”,
“sync_interval” : “60s”,
“durability” : “async”
},
“merge” : {
“scheduler” : {
“max_thread_count” : “1”
},
“policy” : {
“segments_per_tier” : “30”
}
}
}

}

PUT /dispute/_settings
{

“index” : {
“refresh_interval” : “60s”,
“translog” : {
“generation_threshold_size” : “64mb”,
“flush_threshold_size” : “1024mb”,
“sync_interval” : “60s”,
“durability” : “async”
},
“merge” : {
“scheduler” : {
“max_thread_count” : “1”
},
“policy” : {
“segments_per_tier” : “30”
}
}
}

}

PUT /order_item/_settings
{

“index” : {
“refresh_interval” : “60s”,
“translog” : {
“generation_threshold_size” : “64mb”,
“flush_threshold_size” : “1024mb”,
“sync_interval” : “60s”,
“durability” : “async”
},
“merge” : {
“scheduler” : {
“max_thread_count” : “1”
},
“policy” : {
“segments_per_tier” : “30”
}
}
}

}

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5690379.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存