TransportClient Functionality

Hi Team,

We have a few questions regarding Transport Client functionality. On this forum we came to know that Transport Client is thread safe and it is build to be reused by several threads. We have a Java web application and till now we create one Transport Client instance per request. Now we are contemplating of having a single Transport Client serving multiple search requests from web application. We have 3 queries -

  1. Should we create a pool of Transport Clients instead of having only one Client for entire application!

  2. Suppose there is only one Transport Client for the entire app. How this one client instance will manage concurrent search requests. Will it serve only one search request at a time! Won't it slow down the searching as it has to handle multiple requests simultaneously. Please let us know the inner working of Transport Client.

  3. Suppose we stick to one client per request, what would be the impact! Will it lead larger memory footprint?

Thanks

  1. Just create one transport client per JVM instance.

  2. If you look closer at the API, you see that each request is being
    sent asynchronoulsy, so you can easily attach a response callback method
    to each request. This is very fast style of network communication. Of
    course, there is no slowdown if you send multiple requests without
    waiting for response, instead, the throughput will rise in a typical
    server environment.

  3. The impact is not only footprint, it's the rendezvous overhead with
    the cluster, together with slower responses and less throughput. That is
    because you must also take care of the socket consumption. Note that
    each socket is also a file descriptor and each socket will be resident
    even after close for some minutes at the OS level to get eventually be
    reused. Also you won't have much joy with sniffing / failover, which is
    effectively not available if you immediately shut down the client after
    each request.

Jörg

Am 09.04.13 13:16, schrieb ElasticUsers:

Hi Team,

We have a few questions regarding Transport Client functionality. On this
forum we came to know that Transport Client is thread safe and it is build
to be reused by several threads. We have a Java web application and till now
we create one Transport Client instance per request. Now we are
contemplating of having a single Transport Client serving multiple search
requests from web application. We have 3 queries -

  1. Should we create a pool of Transport Clients instead of having only one
    Client for entire application!

  2. Suppose there is only one Transport Client for the entire app. How this
    one client instance will manage concurrent search requests. Will it serve
    only one search request at a time! Won't it slow down the searching as it
    has to handle multiple requests simultaneously. Please let us know the inner
    working of Transport Client.

  3. Suppose we stick to one client per request, what would be the impact!
    Will it lead larger memory footprint?

Thanks

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Jörg,

Thanks for the information.