# Low level Java rest client very slow

**URL:** https://discuss.elastic.co/t/low-level-java-rest-client-very-slow/244035
**Category:** Elasticsearch
**Created:** [August 6, 2020, 2:02pm UTC](https://discuss.elastic.co/t/low-level-java-rest-client-very-slow/244035 "2020-08-06T14:02:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aldm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aldm/32/45644_2.png) [@aldm](https://discuss.elastic.co/u/aldm)
#### Post date: [August 6, 2020, 2:02pm UTC](https://discuss.elastic.co/t/low-level-java-rest-client-very-slow/244035/1 "2020-08-06T14:02:27Z")

</div>

Hi.

We're using Elasticsearch very extensively in our Scala (Akka based) system. We currently moved to Java low level rest client and we're experiencing some issues, namely requests take much more time executed with client as opposed to CURL. And also it is much faster on my local machine (querying remote, development server), than on our development environment.

Here's an example:

GET document. Check performances I got with kibana on DEV environment

Got user profile for user 58803851 in 109  
Got user profile for user 58803851 in 258  
Got user profile for user 58803851 in 144  
Got user profile for user 58803851 in 194  
Got user profile for user 58803851 in 275  
Got user profile for user 58803851 in 495  
Got user profile for user 58803851 in 319  
Got user profile for user 58803851 in 990

On my local machine it lasts for 75 ms constantly. Via curl it takes approximately 70 ms.

Also, search queries vary on DEV environment and it tales toooo much time.

I use only one instance of client to execute all queries. Few questions:

1. Should I maybe create more instance of clients, something like client poll, to make performances better?
2. Why on DEV env it works so slow? I know its busier than my local machine, but again it is not so much used, just our QA and DEV team. Also, when I run code locally I point to DEV Elasticsearch cluster
3. What could I do to make it faster?
4. Can I somehow monitor why some requests from client are slow?

Thanks in advance

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 3, 2020, 2:02pm UTC](https://discuss.elastic.co/t/low-level-java-rest-client-very-slow/244035/2 "2020-09-03T14:02:32Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
