I have 2000 entries in my List and trying to insert this list into elasticsearch by API which is nothing but a bulk request.
Please find below code for the same.
for(Car car : carList){
elasticSearchService.addOrganization(car,"Car");
}
@Autowired
private Client esClient;
private void addOrganization(Object object, String modelName){
Gson gson = new Gson();
final String json = gson.toJson(object);
esClient.prepareIndex("ElasticSearchIndex", modelName).setSource(json).execute().actionGet();
}
I have made following entry in elasticsearch.yml file
threadpool:
index:
size: 250
queue_size: 1000
As we are monitoring performance of the application through JMeter, we found that our application generates 2000 HTTP requests to connect and put data in elasticsearch
which takes around 10 seconds for this task.Can we make connectionpool in esClient or is there any way to do configuration at elasticsearch server so that performance of the application can be improved and
response time will be reduced upto 3 seconds?