ES批量请求`es_rejected_execution_exception`
php小编苹果为您介绍ES批量请求中的常见问题:`es_rejected_execution_exception`。在使用Elasticsearch进行批量请求时,有时会遇到这个异常。这个异常通常表示请求的并发数超过了Elasticsearch服务器的处理能力,导致请求被拒绝执行。本文将为您解析这个异常的原因,并给出解决方案,帮助您顺利处理该问题。
问题内容
我有一个大约 5M 条目的切片(为简单起见,假设每个条目都是一个字节切片,它使用 getIndexerItem
函数映射到索引器项),我将其平均分配给 200 个 go 例程。然后每个go例程调用push
函数,切片长度为5M/200。
根据我对Refresh的理解:wait_for
,每当向elastic发出请求时,只有当该请求所做的更改对搜索可见时才会完成(IMO将其转换为不再有此特定请求的批量请求队列) )。那为什么我会收到此错误?
error indexing item: es_rejected_execution_exception: rejected execution of processing of [358323543][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[ankit-test][3]] containing [3424] requests blocking until refresh, target allocation id: someId, primary term: 1 on EsThreadPoolExecutor [ name = machine_name/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@1f483ca1 [Running, pool size = 32, active threads = 32, queued tasks = 200, completed tasks = 44390708] ]登录后复制