# Configure max threads for java client

**URL:** <https://discuss.elastic.co/t/configure-max-threads-for-java-client/7264>\
**Category:** Elasticsearch\
**Created:** [April 8, 2012, 10:19pm UTC](https://discuss.elastic.co/t/configure-max-threads-for-java-client/7264 "2012-04-08T22:19:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eugen\_Paraschiv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eugen_paraschiv/32/919_2.png) [@Eugen\_Paraschiv](https://discuss.elastic.co/u/Eugen_Paraschiv)\
**Post date:** [April 8, 2012, 10:19pm UTC](https://discuss.elastic.co/t/configure-max-threads-for-java-client/7264/1 "2012-04-08T22:19:10Z")

</div>

Hi,  
I have a simple setup: a java web application communicating with a remote  
elasticsearch server (via the java client); is there any way to configure  
the thread pool of this client?  
I am performing a stress testing session and I'm seeing a very strange  
behavior with the way Tomcat allocates threads: on heavy load, it allocates  
about 100 threads and doesn't go over that.  
I have of course tuned Tomcat to be able to go well over 100 connections,  
which it does - other stress testing sessions will indeed create over 300  
threads and server as many connections.  
I will mention that the operation I'm performing is a simple geospatial  
search (in a polygon), on an index of 20000 location entities, with the  
latest Elasticsearch (0.19.2).  
Any help on this is appreciated.  
Thanks.  
Eugen.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 11, 2012, 9:24am UTC](https://discuss.elastic.co/t/configure-max-threads-for-java-client/7264/2 "2012-04-11T09:24:55Z")

</div>

Thread pools on the client side are basically meaningless, as they are  
"work" thread pools (for search, index, and so on). I don't know why tomcat  
won't create more than 100 threads in your case, but it does not seem like  
it relates to elasticsearch, or at least I can't see how it does.

On Mon, Apr 9, 2012 at 1:19 AM, Eugen Paraschiv [hanriseldon@gmail.com](mailto:hanriseldon@gmail.com)wrote:

> Hi,  
> I have a simple setup: a java web application communicating with a remote  
> elasticsearch server (via the java client); is there any way to configure  
> the thread pool of this client?  
> I am performing a stress testing session and I'm seeing a very strange  
> behavior with the way Tomcat allocates threads: on heavy load, it allocates  
> about 100 threads and doesn't go over that.  
> I have of course tuned Tomcat to be able to go well over 100 connections,  
> which it does - other stress testing sessions will indeed create over 300  
> threads and server as many connections.  
> I will mention that the operation I'm performing is a simple geospatial  
> search (in a polygon), on an index of 20000 location entities, with the  
> latest Elasticsearch (0.19.2).  
> Any help on this is appreciated.  
> Thanks.  
> Eugen.

---

<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:** [July 6, 2017, 3:33am UTC](https://discuss.elastic.co/t/configure-max-threads-for-java-client/7264/3 "2017-07-06T03:33:01Z")

</div>

Closed on July 6, 2017, 3:33am UTC


