# Local transport for embedded (non-local) node

**URL:** <https://discuss.elastic.co/t/local-transport-for-embedded-non-local-node/11506>\
**Category:** Elasticsearch\
**Created:** [April 9, 2013, 2:13pm UTC](https://discuss.elastic.co/t/local-transport-for-embedded-non-local-node/11506 "2013-04-09T14:13:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Klaus\_Brunner](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Klaus\_Brunner](https://discuss.elastic.co/u/Klaus_Brunner)\
**Post date:** [April 9, 2013, 2:13pm UTC](https://discuss.elastic.co/t/local-transport-for-embedded-non-local-node/11506/1 "2013-04-09T14:13:08Z")

</div>

I'm investigating some performance issues with our application, and one of  
the hot spots seems to be the transport of data from Elasticsearch into the  
application. We've been using the Java Transport Client for this so far.

Since our data will easily fit a single machine and are rarely updated,  
we're effectively running a "replication" architecture: each machine holds  
one application instance and one instance of ES; the application will only  
talk to the ES node on the same machine. Our application fetches quite a  
few results from ES on each call, so there's a lot of data being  
transferred within the same machine.

My optimisation idea now was to embed ES into the application to  
short-circuit the TCP transport to the application, basically doing this:

```
    Node node = nodeBuilder().node(); // settings loaded from 

```

elasticsearch.yml  
client = node.client();

While this functionally works as expected (that is, exactly the same as  
before with each ES running in a separate VM), I'm still seeing a lot of  
Netty activity in the profiler - which goes against my original assumption  
that this client would talk to the node via local "transport" (i.e. passing  
in-memory references), not TCP.

Looking through the API and org.elasticsearch.transport.TransportModule, it  
seems that you can either create a local node and access that via local  
transport, or create a non-local node and use TCP transport. Is there any  
way to get a local transport client for a "regular" (but embedded) node?

Thanks

Klaus

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [April 9, 2013, 2:52pm UTC](https://discuss.elastic.co/t/local-transport-for-embedded-non-local-node/11506/2 "2013-04-09T14:52:32Z")

</div>

You may want to use Node node = nodeBuilder().local(true).node() in your  
app, this disables external communication via a network interface.

Jörg

Am 09.04.13 16:13, schrieb Klaus Brunner:

> I'm investigating some performance issues with our application, and  
> one of the hot spots seems to be the transport of data from  
> Elasticsearch into the application. We've been using the Java  
> Transport Client for this so far.
> 
> Since our data will easily fit a single machine and are rarely  
> updated, we're effectively running a "replication" architecture: each  
> machine holds one application instance and one instance of ES; the  
> application will only talk to the ES node on the same machine. Our  
> application fetches quite a few results from ES on each call, so  
> there's a lot of data being transferred within the same machine.
> 
> My optimisation idea now was to embed ES into the application to  
> short-circuit the TCP transport to the application, basically doing this:
> 
> ```
> Node node = nodeBuilder().node(); // settings loaded from 
> 
> ```
> 
> elasticsearch.yml  
> client = node.client();
> 
> While this functionally works as expected (that is, exactly the same  
> as before with each ES running in a separate VM), I'm still seeing a  
> lot of Netty activity in the profiler - which goes against my original  
> assumption that this client would talk to the node via local  
> "transport" (i.e. passing in-memory references), not TCP.
> 
> Looking through the API and  
> org.elasticsearch.transport.TransportModule, it seems that you can  
> either create a local node and access that via local transport, or  
> create a non-local node and use TCP transport. Is there any way to get  
> a local transport client for a "regular" (but embedded) node?

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Klaus\_Brunner](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Klaus\_Brunner](https://discuss.elastic.co/u/Klaus_Brunner)\
**Post date:** [April 9, 2013, 3:32pm UTC](https://discuss.elastic.co/t/local-transport-for-embedded-non-local-node/11506/3 "2013-04-09T15:32:49Z")

</div>

On Tuesday, 9 April 2013 16:52:32 UTC+2, Jörg Prante wrote:

> You may want to use Node node = nodeBuilder().local(true).node() in your  
> app, this disables external communication via a network interface.

But that would disable cluster communication entirely, wouldn't it? Our ES  
instances are still supposed to be clustered across several machines, so  
that data updates are replicated.

Klaus

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:41am UTC](https://discuss.elastic.co/t/local-transport-for-embedded-non-local-node/11506/4 "2017-07-06T02:41:59Z")

</div>


