# Slow performance when creating a new client node

**URL:** <https://discuss.elastic.co/t/slow-performance-when-creating-a-new-client-node/4077>\
**Category:** Elasticsearch\
**Created:** [March 10, 2011, 6:16pm UTC](https://discuss.elastic.co/t/slow-performance-when-creating-a-new-client-node/4077 "2011-03-10T18:16:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@jason](https://discuss.elastic.co/u/jason)\
**Post date:** [March 10, 2011, 6:16pm UTC](https://discuss.elastic.co/t/slow-performance-when-creating-a-new-client-node/4077/1 "2011-03-10T18:16:02Z")

</div>

Hi everyone,

I noticed that every time I create a new node, it takes maybe 10 or  
more seconds.

```
        Node node = nodeBuilder().node();
        Client client = node.client(); //this line takes longer than

```

expected

If I keep adding new documents under the same index, should they be  
stored on a single node? At what point I should switch to a new (or  
next) client node? Is there a limit of what load a single node or  
single index can handle?

Thank you,  
Eugene.

---

<div class="post-metadata">

**Author:** ![ppearcy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppearcy/32/980_2.png) [@ppearcy](https://discuss.elastic.co/u/ppearcy)\
**Post date:** [March 11, 2011, 2:08am UTC](https://discuss.elastic.co/t/slow-performance-when-creating-a-new-client-node/4077/2 "2011-03-11T02:08:01Z")

</div>

Hey,  
Clients should be instantiated once and shared between threads. The  
client connects to the entire cluster, so no need to switch the client  
in your app.

Indexes can get very large, and with sharding there is no hard limit  
other than disk and ram.

Hope this helps,  
Paul

On Mar 10, 11:16 am, eugene [efur...@gmail.com](mailto:efur...@gmail.com) wrote:

> Hi everyone,
> 
> I noticed that every time I create a new node, it takes maybe 10 or  
> more seconds.
> 
> ```
> Node node = nodeBuilder().node();
> Client client = node.client(); //this line takes longer than
> 
> ```
> 
> expected
> 
> If I keep adding new documents under the same index, should they be  
> stored on a single node? At what point I should switch to a new (or  
> next) client node? Is there a limit of what load a single node or  
> single index can handle?
> 
> Thank you,  
> Eugene.

---

<div class="post-metadata">

**Author:** ![jason](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@jason](https://discuss.elastic.co/u/jason)\
**Post date:** [March 11, 2011, 2:16am UTC](https://discuss.elastic.co/t/slow-performance-when-creating-a-new-client-node/4077/3 "2011-03-11T02:16:26Z")

</div>

Thank you, Paul. This is really helpful!

On Mar 10, 6:08 pm, Paul [ppea...@gmail.com](mailto:ppea...@gmail.com) wrote:

> Hey,  
> Clients should be instantiated once and shared between threads. The  
> client connects to the entire cluster, so no need to switch the client  
> in your app.
> 
> Indexes can get very large, and with sharding there is no hard limit  
> other than disk and ram.
> 
> Hope this helps,  
> Paul
> 
> On Mar 10, 11:16 am, eugene [efur...@gmail.com](mailto:efur...@gmail.com) wrote:
> 
> > Hi everyone,
> 
> > I noticed that every time I create a new node, it takes maybe 10 or  
> > more seconds.
> 
> > ```
> > Node node = nodeBuilder().node();
> > Client client = node.client(); //this line takes longer than
> > 
> > ```
> > 
> > expected
> 
> > If I keep adding new documents under the same index, should they be  
> > stored on a single node? At what point I should switch to a new (or  
> > next) client node? Is there a limit of what load a single node or  
> > single index can handle?
> 
> > Thank you,  
> > Eugene.- Hide quoted text -
> 
> - Show quoted text -

---

<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, 4:10am UTC](https://discuss.elastic.co/t/slow-performance-when-creating-a-new-client-node/4077/4 "2017-07-06T04:10:20Z")

</div>


