不为失败找理由,要为成功找方法。

ES批量写入很慢

Elasticsearch | 作者 huigy | 发布于2017年12月04日 | 阅读数:16525

CPU:E5 8核 2.5G
硬盘:企业sata
内存:32G
 
mapping:
{
  "settings": {
    "number_of_shards": "1",
    "number_of_replicas": "0",
    "refresh_interval": "60s",
    "translog": {
      "sync_interval": "60s",
      "durability": "async",
      "flush_threshold_size": "1g"
    }
  },
  "mappings": {
    "docs": {
      "_all": {
        "enabled": false
      },
      "properties": {
        "title": {
          "analyzer": "ik2_max_word",
          "search_analyzer": "ik2_smart",
          "type": "text"
        },
        "year": {
          "type": "integer"
        },
        "type": {
          "type": "keyword"
        },
        "short": {
          "type": "integer"
        },
        "term": {
          "type": "integer"
        },
        "sortType": {
          "type": "integer"
        },
        "sortTerm": {
          "type": "integer"
        },
        "sortRegion": {
          "type": "integer"
        },
        "sortSchool": {
          "type": "integer"
        }
      }
    }
  }
}
 
本机利用客户端调用bulk写入:100W数据耗时4.5分钟,平均每秒写入3500条。
开启9个线程,每次提交5W数据。
 
请问如何配置能实现单机本地写入达到10W/s
 
 
已邀请:

puyunjiafly

赞同来自:

_id 是默认的吗?
硬盘是固态硬盘吗?
要求这么高的写入索引能省去吗?
 
indices.memory.index_buffer_size可以配置高点
 
refresh_interval: -1
 
translog异步你也配置了
 
ik分词本身也耗时吧我记得?可以换默认分词试试速度?
 
就算是也没办法到10W/s吧。
 
如果能达到求楼主分享。
就算不是用的es。。。

wntp - 80后IT♂

赞同来自:

10w/s 这个似乎感觉有点难

huigy

赞同来自:

谢谢楼上的兄弟,看来只能用集群了

ELKer

赞同来自:

单节点10w/s估计不行,但是3500是少了,根据官方的benchmark怎么也得个好几万,具体配置忘了,你每批次5W数据不知道多不多,建议是5-15MB,可以算下

huigy

赞同来自:

数据很小,5W数据最多也就8M左右

要回复问题请先登录注册