【发布时间】:2015-04-24 07:36:52
【问题描述】:
我创建了一个用于记录的索引。
这意味着主要是写入,偶尔会有一些搜索。 在第一次加载阶段,我使用多个客户端使用批量 API 并发索引文档。
起初,为 5000 个文档建立索引需要 200 毫秒。 随着时间的推移,索引时间增加,达到 1000-4500 毫秒。
我正在使用具有 32 个内核和 60 GB 内存的 EC2 c3.8xl 机器,并将 IO 预置卷设置为 7000 IOPS。
我有 10 个分片,没有副本,都在同一台机器上。 ATM,索引中有大约 15 亿条记录。
查看指标,我看到 CPU 和内存都很好,写入 IOPS 为 300,但读取 IOPS 缓慢上升,达到了 7000。
为什么我只是索引,但大部分 IOPS 都被读取了?
我的设置是:
threadpool.bulk.type: fixed
threadpool.bulk.size: 32 # availableProcessors
threadpool.bulk.queue_size: 1000
# Indices settings
indices.memory.index_buffer_size: 50%
indices.cache.filter.expire: 6h
bootstrap.mlockall: true
我已将索引设置更改为:
{"index":{"refresh_interval":"60m",
"translog":
{"flush_threshold_size":"1gb",
"flush_threshold_ops":"50000"}
}
}
我也试过 "refresh_interval":"-1"
如果需要,请告诉我我还需要提供什么(设置、日志、指标)。以下是节点统计信息:
"_all": {
"primaries": {
"docs": {
"count": 1473959582,
"deleted": 1376161
},
"store": {
"size_in_bytes": 497545621011,
"throttle_time_in_millis": 102780138
},
"indexing": {
"index_total": 416653525,
"index_time_in_millis": 679407284,
"index_current": 0,
"delete_total": 0,
"delete_time_in_millis": 0,
"delete_current": 0,
"noop_update_total": 1,
"is_throttled": false,
"throttle_time_in_millis": 0
},
"get": {
"total": 2943640,
"time_in_millis": 15160148,
"exists_total": 1445558,
"exists_time_in_millis": 7460238,
"missing_total": 1498082,
"missing_time_in_millis": 7699910,
"current": 0
},
"search": {
"open_contexts": 0,
"query_total": 70,
"query_time_in_millis": 12238,
"query_current": 0,
"fetch_total": 2,
"fetch_time_in_millis": 23,
"fetch_current": 0
},
"merges": {
"current": 0,
"current_docs": 0,
"current_size_in_bytes": 0,
"total": 4184,
"total_time_in_millis": 128875711,
"total_docs": 1282672895,
"total_size_in_bytes": 429203874419
},
"refresh": {
"total": 1930,
"total_time_in_millis": 1816632
},
"flush": {
"total": 7774,
"total_time_in_millis": 4783754
},
"warmer": {
"current": 0,
"total": 23565,
"total_time_in_millis": 1792
},
"filter_cache": {
"memory_size_in_bytes": 184938864,
"evictions": 0
},
"id_cache": {
"memory_size_in_bytes": 0
},
"fielddata": {
"memory_size_in_bytes": 0,
"evictions": 0
},
"percolate": {
"total": 0,
"time_in_millis": 0,
"current": 0,
"memory_size_in_bytes": -1,
"memory_size": "-1b",
"queries": 0
},
"completion": {
"size_in_bytes": 0
},
"segments": {
"count": 368,
"memory_in_bytes": 877782264,
"index_writer_memory_in_bytes": 23671280,
"index_writer_max_memory_in_bytes": 5368709120,
"version_map_memory_in_bytes": 19674480,
"fixed_bit_set_memory_in_bytes": 0
},
"translog": {
"operations": 213819,
"size_in_bytes": 19598986
},
"suggest": {
"total": 0,
"time_in_millis": 0,
"current": 0
},
"query_cache": {
"memory_size_in_bytes": 0,
"evictions": 0,
"hit_count": 0,
"miss_count": 0
},
"recovery": {
"current_as_source": 0,
"current_as_target": 0,
"throttle_time_in_millis": 0
}
}
【问题讨论】:
标签: elasticsearch