I have a requirement to fetch 10k documents around a lat long in 10km radius while below query works fine but take around 350 ms to fetch all the documents. is there any other way to improve on this was expecting latencies to be less than 200 ms
version : 7.9.1
size of index : 50MB
Number of shards : 2
cluster configuration
Number of master nodes : 3
master node ec2 instance : m5.large
Number of Data nodes : 2
data node ec2 instance : c5.4xlarge
I suspect the vast majority of that 350 milliseconds is the actual marshalling and construction of the response json document.
And is that 350 milliseconds measured from where?
You can run it in the profiler and see how long it's actually taking.
But 10,000 documents, even though they're small is going to take time to marshall and transmit.
Not that this matters really but that's a 100km not 10 km
"distance": 100000
Also if it the actual query you could try
"distance_type" : "plane"
To speed it up
Curious what the took says
And also curious How you arrived at 200 milliseconds should be good for the 10,000 documents. Did you get that performance before?
Do you need all 10,000 documents in a single response or could you page through them?
Also, 7.9.1 is very old. There's been a number of performance improvements we're all the way up at 8.4 with. There has been significant underlying changes to the lucene engine. I would also try upgrading if you can.
And as I'm sure Christian was getting to EBS is not the best storage for high IO Not that it won't work, but it's certainly not the lowest latency option.. on the other hand, if you keep hitting those indices and there's not much else going on, most of those indices could be in RAM... But if it's a busy cluster that won't be the case.
Hey @stephenb Thanks
we tried hitting the cluster with our microservice with sufficient throughput and tried few requests with kibana also . i corrected the distance was a typo mistake
no improvement by changing "distance_type" : "plane"
value in took is always more than 300 ms
Not really we just thought that 200 ms would be enough for this operation based on the data we had on other operations though size was less for other operations so it seems like majority of time spent is in marshall and transmit.
update is not an option for now but thanks for the recommendation
This is the new cluster we created to support this operation only so no other indices would be in RAM and still latencies are high that means storage is most probably not an issue
Btw we tried our experiment for 1 hour will the latencies improve if we increase the time period ?
One option to try and help reduce some latency, if you only need parts of your documents returned (rather than the whole document), you can look into filter_path, and only return what is needed. This would in theory reduce the return payload to the microservice querying Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.