使用 dmesg 来查看一些硬件或驱动程序的信息或问题。

大批量插入suggester的index, 疯狂gc,最后触发timeout是插入失败, 普通index无问题

Elasticsearch | 作者 yuechen323 | 发布于2020年01月08日 | 阅读数:947

mapping 如下
 
{
"settings": {
"index" : {
"refresh_interval" : "60s"
},
"analysis": {
"analyzer": {
"pinyin_analyzer": {
"tokenizer": "my_pinyin"
}
},
"tokenizer": {
"my_pinyin": {
"type": "pinyin",
"keep_first_letter": true,
"keep_separate_first_letter": true,
"keep_full_pinyin": true,
"keep_original": false,
"limit_first_letter_length": 16,
"lowercase": true
}
}
}
},
"mappings": {
"properties" : {
"suggest" : {
"type" : "completion",
"analyzer": "ik_max_word",
"fields":{
"pinyin": {
"type" : "completion",
"analyzer": "pinyin_analyzer"
}
}
}
}
}
}
 
版本7.4.0
服务器16g xmx8g xms8g
尝试了使用 java API, 以及 RestTemplate 来批量插入, 插一会儿 gc 的非常频繁, 每次 STW, 都会导致插入操作停顿, 最后超过30s的限制, 而导致插入失败
 
而不包含 suggester 的索引无论怎么插入, 比如8个线程同时 bulk 3000一个批次这种插入, 表现都很良好, 不知道是否根 suggester 有关
已邀请:

God_lockin

赞同来自:

你是用index/put的方式塞的吧

God_lockin

赞同来自:

suggestion的索引和普通的索引不一样(会更复杂),然后带着分词器的设置会让他多一份操作,自然会比普通插入的速度慢

要回复问题请先登录注册