保存一周的数据,每天15T左右,条数大概在200亿左右,索引按照8小时、或者按天分,最大的索引大概在2T多。
用了不到50个data node(20多台服务器,一台服务器2个node),3个master,1 replica。
data node是32核,128g内存,12块机械硬盘。
每个节点锁定的31G的java heap
bulk process 几个阈值分别是15M,20000request,30s。用的transport client
主要参数如下:
index.refresh_interval: 30s
index.refresh_interval: 30s
index.number_of_shards: 48
index.translog.flush_threshold_size : 5000mb
index.translog.flush_threshold_ops: 50000
indices.store.throttle.max_bytes_per_sec: 1000mb
"threadpool.index.queue_size": 1000,
"threadpool.index.size":32,
"indices.memory.index_buffer_size":"20%",
"index.merge.policy.use_compound_file":"false"
"cluster.routing.allocation.balance.shard":"0.01f",
"cluster.routing.allocation.balance.index":"0.99f"
"threadpool.bulk.size":32
1. 如果是写一个只有插入操作的索引,最高能到50w qps 左右,如果是写一个有update操作的索引,最高只能到20w qps左右,如果只有insert操作的索引和有大量update操作的索引同时都写集群,性能只能到30w qps左右。感觉有点慢,测单机时候qps能到4-5w左右,集群性能感觉还是差很多,有什么可以优化的地方?针对insert和update操作对性能的影响,可以怎么优化?目前打算用tag来做routing,隔离这两组日志。一般这样的服务器规模能到多少写入qps?
2. 集群一旦有服务器离群,重新初始化unsigned shard就很慢,需要2个小时左右甚至更长,即使离群的节点很快重新加入。下面是一些相关的初始化参数
indices.recovery.max_bytes_per_sec = 2G
indices.recovery.concurrent_streams = 30
cluster.routing.allocation.node_initial_primaries_recoveries: 52
3. 目前rebalance也没有开。如果打开,每次掉节点后初始化shard之后就要relocate,这个过程非常长(天级),整个过程中,写入qps下降的厉害。
大家给给建议