单次发大量bool查询条件,ES的java堆栈内存溢出

记录:单次发大量查询条件(10万条bool查询条件),查询单个节点的ES,起初会导致ES查询超时;后来会导致无可用节点;持续将导致ES的java堆栈内存溢出

解决方法:

1.从源头控制每次产生bool查询条件的数量;

2.只允许限定数量的bool查询条件(10240个,默认1024个),丢弃超过限定数量的请求(在elasticsearch.yml配置文件中做限制)。

indices.query.bool.max_clause_count: 10240

---------------------------------------------------------------------------------------------------------------------------------------

以下其他超时问题【仅供参考】:

docker中ES超时导致的无可用节点现象,一种情况下的解决方案【非长久之计】(参考):

https://stackoverflow.com/questions/51186500/elasticsearch-timed-out-waiting-for-all-nodes-to-process-published-state-and

Using docker restart instead of docker stop solves the problem. See: https://discuss.elastic.co/t/timed-out-waiting-for-all-nodes-to-process-published-state-and-cluster-unavailability/138590

 

 

转载于:https://my.oschina.net/airship/blog/3083879

你可能感兴趣的:(单次发大量bool查询条件,ES的java堆栈内存溢出)