-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
I just had a scenario where I had to use Elasticsearch from a Tornado web service via its ThreadPoolExecutor
integration. I was noticing terrible tail latencies on queries. After some digging, I discovered this was because of the maxsize
parameter on the default connection class, documented here. The issue was that though my thread pool supported up to 500 threads, it was limited by the 10 concurrent connections that the driver had set on the underlying pool.
Thankfully, I could fix this by passing "maxsize" to the Elasticsearch
object, since this then passes through to the connection object. But given how big an impact this parameter has on performance in multi-threaded scenarios, I think the documentation should call it out much more prominently. People are probably running very slow code in production without realizing it, even if they have big ES clusters, as a result of leaving this default.