jmeter - How to improve performance of application for inserting list in elasticSearch? -


i have 2000 entries in list , trying insert list elasticsearch api nothing bulk request. please find below code same.

     for(car car : carlist){             elasticsearchservice.addorganization(car,"car");         }  code elasticsearch service          @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();         }  have made following entry in elasticsearch.yml file threadpool:     index:         size: 250         queue_size: 1000  

as monitoring performance of application through jmeter, found our application generates 2000 http requests connect , put data in elasticsearch takes around 10 seconds task.can make connectionpool in esclient or there way configuration @ elasticsearch server performance of application can improved , response time reduced upto 3 seconds?

you speaking of bulk requests not using them:

change code to:

elasticsearchservice.addorganizations(carlist,"car"); 

and elasticsearch service code to:

@autowired private client esclient;  private void addorganizations(list<object> objects, string modelname){     bulkrequestbuilder bulkrequest = client.preparebulk();     objects.foreach(object -> {         gson gson  = new gson();         final string json = gson.tojson(object);         bulkrequest.add(esclient.prepareindex("elasticsearchindex",modelname).setsource(json));     });     bulkrequest.get(); } 

see documentation have more information.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -