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 -
Should we create a pool of Transport Clients instead of having only one Client for entire application!
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.
Suppose we stick to one client per request, what would be the impact! Will it lead larger memory footprint?
Just create one transport client per JVM instance.
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.
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 -
Should we create a pool of Transport Clients instead of having only one
Client for entire application!
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.
Suppose we stick to one client per request, what would be the impact!
Will it lead larger memory footprint?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.