# How many Transport Clients do I need in one Java application?

**URL:** <https://discuss.elastic.co/t/how-many-transport-clients-do-i-need-in-one-java-application/46489>\
**Category:** Elasticsearch\
**Created:** [April 6, 2016, 7:50am UTC](https://discuss.elastic.co/t/how-many-transport-clients-do-i-need-in-one-java-application/46489 "2016-04-06T07:50:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![whzcl](https://avatars.discourse-cdn.com/v4/letter/w/eb8c5e/32.png) [@whzcl](https://discuss.elastic.co/u/whzcl)\
**Post date:** [April 6, 2016, 7:50am UTC](https://discuss.elastic.co/t/how-many-transport-clients-do-i-need-in-one-java-application/46489/1 "2016-04-06T07:50:43Z")

</div>

Hi,

Our Java application clusters are using the transport clients to query data from ElasticSearch.  
Since our application clusters are nearly 1000 thousands tomcat instances, if each tomcat instance hold many transports clients, such as 50 transport clients, the sum will be 1000 \* 50 transports.

ElasticSearch version: 1.5.2  
server numbers: 5( cpu:24 cores, mem:64G, hd: 2.4T)

Our query qps: 100/second

My question:

1. If the sum of all the transport clients is 50000, can the elasticsearch servers accept such many transport clients(As far as I know, one transport client will occupy more than 10 tcp connections, as a result: 50000 \* 10 \> all the port numbers in one machine 65535 )?
2. If I only accept assign one transport client to each tomcat instance, can one transport client handle parallel requests simultaneously, for example, 100 qps?

---

<div class="post-metadata">

**Author:** ![whzcl](https://avatars.discourse-cdn.com/v4/letter/w/eb8c5e/32.png) [@whzcl](https://discuss.elastic.co/u/whzcl)\
**Post date:** [April 6, 2016, 9:57am UTC](https://discuss.elastic.co/t/how-many-transport-clients-do-i-need-in-one-java-application/46489/2 "2016-04-06T09:57:35Z")

</div>

From this link, I have known that we should have only one transportClient in our application!

> [@Transport Client in ES](https://discuss.elastic.co/t/transport-client-in-es/44110):
>
> Hi, We have an requirement where we have to use the delete by query plugin. As per new ES version 2.x the delete by query is used as an plugin through Transport client as shown below: private TransportClient dc1Client = null; this.dc1Client=TransportClient.builder().settings(settings).addPlugin(DeleteByQueryPlugin.class).build(); We have been using same transport client for indexing and searching. But adding the delete plugin will make it heavy while performing search and index operations. …

---

<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 5, 2017, 11:01pm UTC](https://discuss.elastic.co/t/how-many-transport-clients-do-i-need-in-one-java-application/46489/3 "2017-07-05T23:01:56Z")

</div>


