溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

elasticsearch寫(xiě)入優(yōu)化的示例分析

發(fā)布時(shí)間:2022-01-10 10:22:04 來(lái)源:億速云 閱讀:168 作者:柒染 欄目:大數(shù)據(jù)

小編今天帶大家了解elasticsearch寫(xiě)入優(yōu)化的示例分析,文中知識(shí)點(diǎn)介紹的非常詳細(xì)。覺(jué)得有幫助的朋友可以跟著小編一起瀏覽文章的內(nèi)容,希望能夠幫助更多想解決這個(gè)問(wèn)題的朋友找到問(wèn)題的答案,下面跟著小編一起深入學(xué)習(xí)“elasticsearch寫(xiě)入優(yōu)化的示例分析”的知識(shí)吧。

全量dump數(shù)據(jù)時(shí),為優(yōu)化性能,可做如下優(yōu)化。

  1. 分片設(shè)置,不分片

http://localhost:9200/test_index/_settings/
{
  "index": {
    "number_of_replicas": 0
  }
}
  1. 刷新設(shè)置,不刷新

http://localhost:9200/test_index/_settings/
{
  "index": {
    "refresh_interval": "-1"
  }
}
  1. translog 大小設(shè)置,調(diào)大 默認(rèn)512M

http://localhost:9200/test_index/_settings/
{
  "index.translog.flush_threshold_size": "1024mb"
}
  1. 如果是SSD硬盤(pán),修改段合并速率

http://localhost:9200/_cluster/settings/
{
  "persistent": {
    "indices.store.throttle.max_bytes_per_sec": "200mb"
  }
}

http://localhost:9200/_cluster/settings/
{
  "transient": {
    "indices.store.throttle.type": "none"
  }
}

全量dump后,再恢復(fù)一下

  1. 分片設(shè)置

http://localhost:9200/test_index/_settings/
{
  "index": {
    "number_of_replicas": 2
  }
}
  1. 刷新設(shè)置,不刷新

http://localhost:9200/test_index/_settings/
{
  "index": {
    "refresh_interval": "1s"
  }
}
  1. translog 大小設(shè)置

http://localhost:9200/test_index/_settings/
{
  "index.translog.flush_threshold_size": "512mb"
}

當(dāng)然應(yīng)該使用bulk模式, elasticsearch單次提交數(shù)據(jù)盡量在15M以內(nèi)。

感謝大家的閱讀,以上就是“elasticsearch寫(xiě)入優(yōu)化的示例分析”的全部?jī)?nèi)容了,學(xué)會(huì)的朋友趕緊操作起來(lái)吧。相信億速云小編一定會(huì)給大家?guī)?lái)更優(yōu)質(zhì)的文章。謝謝大家對(duì)億速云網(wǎng)站的支持!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI