# Javascript es client - should es clients be pooled?

**URL:** https://discuss.elastic.co/t/javascript-es-client-should-es-clients-be-pooled/21385
**Category:** Elasticsearch
**Created:** [December 24, 2014, 5:34pm UTC](https://discuss.elastic.co/t/javascript-es-client-should-es-clients-be-pooled/21385 "2014-12-24T17:34:05Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Phil\_Swenson\_2](https://avatars.discourse-cdn.com/v4/letter/p/aca169/32.png) [@Phil\_Swenson\_2](https://discuss.elastic.co/u/Phil_Swenson_2)
#### Post date: [December 24, 2014, 5:34pm UTC](https://discuss.elastic.co/t/javascript-es-client-should-es-clients-be-pooled/21385/1 "2014-12-24T17:34:05Z")

</div>

I'm writing a node/es app using the es javascript api....

Is there any reason to use pooling for all the javascript clients? Or  
should I just use one client for the app?

Thanks,  
phil

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a44a6a6e-8763-44f5-9e2d-8ea52dcf0345%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a44a6a6e-8763-44f5-9e2d-8ea52dcf0345%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Phil\_Swenson\_2](https://avatars.discourse-cdn.com/v4/letter/p/aca169/32.png) [@Phil\_Swenson\_2](https://discuss.elastic.co/u/Phil_Swenson_2)
#### Post date: [December 26, 2014, 5:55pm UTC](https://discuss.elastic.co/t/javascript-es-client-should-es-clients-be-pooled/21385/2 "2014-12-26T17:55:17Z")

</div>

no answer, so let me ask a different way. how are most of the es  
javascript client apps managing the instance of the client?

do you have one es client per app (singleton) that all requests go  
through? Do you create and destroy clients for every request? Do you use  
a es client pool using something like  
[GitHub - coopernurse/node-pool: Generic resource pooling for node.js](https://github.com/coopernurse/node-pool) ?

Thanks for any comments!

phil

On Wed, Dec 24, 2014 at 10:34 AM, Phil Swenson [phil.swenson@gmail.com](mailto:phil.swenson@gmail.com)  
wrote:

> I'm writing a node/es app using the es javascript api....
> 
> Is there any reason to use pooling for all the javascript clients? Or  
> should I just use one client for the app?
> 
> Thanks,  
> phil
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/a44a6a6e-8763-44f5-9e2d-8ea52dcf0345%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a44a6a6e-8763-44f5-9e2d-8ea52dcf0345%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/a44a6a6e-8763-44f5-9e2d-8ea52dcf0345%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/a44a6a6e-8763-44f5-9e2d-8ea52dcf0345%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGenvhVYD-fRkrVx5j0XR\_xNYM2eSFFFxh2TxJnEar-HEWVfSg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGenvhVYD-fRkrVx5j0XR_xNYM2eSFFFxh2TxJnEar-HEWVfSg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jackpark](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jackpark](https://discuss.elastic.co/u/jackpark)
#### Post date: [December 26, 2014, 6:57pm UTC](https://discuss.elastic.co/t/javascript-es-client-should-es-clients-be-pooled/21385/3 "2014-12-26T18:57:05Z")

</div>

On my platform, there is one and only one es client, through which all  
requests go. It seems to work well, though "well" is defined as having just  
a few people using it at one time. We plan to start stress testing the  
system soon.

Cheers  
Jack

On Fri, Dec 26, 2014 at 9:55 AM, phil swenson [phil.swenson@gmail.com](mailto:phil.swenson@gmail.com)  
wrote:

> no answer, so let me ask a different way. how are most of the es  
> javascript client apps managing the instance of the client?
> 
> do you have one es client per app (singleton) that all requests go  
> through? Do you create and destroy clients for every request? Do you use  
> a es client pool using something like  
> [GitHub - coopernurse/node-pool: Generic resource pooling for node.js](https://github.com/coopernurse/node-pool) ?
> 
> Thanks for any comments!
> 
> phil
> 
> On Wed, Dec 24, 2014 at 10:34 AM, Phil Swenson [phil.swenson@gmail.com](mailto:phil.swenson@gmail.com)  
> wrote:
> 
> > I'm writing a node/es app using the es javascript api....
> > 
> > Is there any reason to use pooling for all the javascript clients? Or  
> > should I just use one client for the app?
> > 
> > Thanks,  
> > phil
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/a44a6a6e-8763-44f5-9e2d-8ea52dcf0345%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a44a6a6e-8763-44f5-9e2d-8ea52dcf0345%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/a44a6a6e-8763-44f5-9e2d-8ea52dcf0345%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/a44a6a6e-8763-44f5-9e2d-8ea52dcf0345%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAGenvhVYD-fRkrVx5j0XR\_xNYM2eSFFFxh2TxJnEar-HEWVfSg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGenvhVYD-fRkrVx5j0XR_xNYM2eSFFFxh2TxJnEar-HEWVfSg%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAGenvhVYD-fRkrVx5j0XR\_xNYM2eSFFFxh2TxJnEar-HEWVfSg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAGenvhVYD-fRkrVx5j0XR_xNYM2eSFFFxh2TxJnEar-HEWVfSg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAH6s0fyEhW5b-BXCYViAb7Ej4XNC5shjjVE\_kYfPKOcx6H-dng%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAH6s0fyEhW5b-BXCYViAb7Ej4XNC5shjjVE_kYfPKOcx6H-dng%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Phil\_Swenson\_2](https://avatars.discourse-cdn.com/v4/letter/p/aca169/32.png) [@Phil\_Swenson\_2](https://discuss.elastic.co/u/Phil_Swenson_2)
#### Post date: [December 29, 2014, 10:00pm UTC](https://discuss.elastic.co/t/javascript-es-client-should-es-clients-be-pooled/21385/4 "2014-12-29T22:00:06Z")

</div>

thanks jack, let me know how your testing goes!

On Fri, Dec 26, 2014 at 11:57 AM, Jack Park [jackpark@topicquests.org](mailto:jackpark@topicquests.org)  
wrote:

> On my platform, there is one and only one es client, through which all  
> requests go. It seems to work well, though "well" is defined as having just  
> a few people using it at one time. We plan to start stress testing the  
> system soon.
> 
> Cheers  
> Jack
> 
> On Fri, Dec 26, 2014 at 9:55 AM, phil swenson [phil.swenson@gmail.com](mailto:phil.swenson@gmail.com)  
> wrote:
> 
> > no answer, so let me ask a different way. how are most of the es  
> > javascript client apps managing the instance of the client?
> > 
> > do you have one es client per app (singleton) that all requests go  
> > through? Do you create and destroy clients for every request? Do you use  
> > a es client pool using something like  
> > [GitHub - coopernurse/node-pool: Generic resource pooling for node.js](https://github.com/coopernurse/node-pool) ?
> > 
> > Thanks for any comments!
> > 
> > phil
> > 
> > On Wed, Dec 24, 2014 at 10:34 AM, Phil Swenson [phil.swenson@gmail.com](mailto:phil.swenson@gmail.com)  
> > wrote:
> > 
> > > I'm writing a node/es app using the es javascript api....
> > > 
> > > Is there any reason to use pooling for all the javascript clients? Or  
> > > should I just use one client for the app?
> > > 
> > > Thanks,  
> > > phil
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/a44a6a6e-8763-44f5-9e2d-8ea52dcf0345%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a44a6a6e-8763-44f5-9e2d-8ea52dcf0345%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/a44a6a6e-8763-44f5-9e2d-8ea52dcf0345%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/a44a6a6e-8763-44f5-9e2d-8ea52dcf0345%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/CAGenvhVYD-fRkrVx5j0XR\_xNYM2eSFFFxh2TxJnEar-HEWVfSg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGenvhVYD-fRkrVx5j0XR_xNYM2eSFFFxh2TxJnEar-HEWVfSg%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CAGenvhVYD-fRkrVx5j0XR\_xNYM2eSFFFxh2TxJnEar-HEWVfSg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAGenvhVYD-fRkrVx5j0XR_xNYM2eSFFFxh2TxJnEar-HEWVfSg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAH6s0fyEhW5b-BXCYViAb7Ej4XNC5shjjVE\_kYfPKOcx6H-dng%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAH6s0fyEhW5b-BXCYViAb7Ej4XNC5shjjVE_kYfPKOcx6H-dng%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAH6s0fyEhW5b-BXCYViAb7Ej4XNC5shjjVE\_kYfPKOcx6H-dng%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAH6s0fyEhW5b-BXCYViAb7Ej4XNC5shjjVE_kYfPKOcx6H-dng%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGenvhX4Gk80WG%3D33QzTzpDL-PDQ4eOm4JZZkToG1sXCY\_bVfw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGenvhX4Gk80WG%3D33QzTzpDL-PDQ4eOm4JZZkToG1sXCY_bVfw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:41am UTC](https://discuss.elastic.co/t/javascript-es-client-should-es-clients-be-pooled/21385/5 "2017-07-06T00:41:32Z")

</div>


