I have a use case in which i want to create per index per account (assume
an account represents an user), all data belong to that user will be kept
in that index. My question is - what if we create connection per index and
keep it alive during the user session. So this means for 100 active users,
there will be 100 connections from TransportClient to ES Cluster. I don't
have a reason why I have 100 instances of TransportClient has to be
initialized and kept in memory. Not sure if a singleton would unnecessarily
bring thread locks.
You can enlarge thread pools in TransportClient, also Netty worker threads.
User session states should be managed in the front-end service (reverse
proxy or Java middleware e.g.) so it is still ok to use a singleton
TransportClient since it is stateless. It handles requests and the
corresponding responses.
If 100 users are active at the same time, resources might get low, so you
should think about ramping up a line of front-end services on more than one
machine to balance the front-end load.
I have a use case in which i want to create per index per account (assume
an account represents an user), all data belong to that user will be kept
in that index. My question is - what if we create connection per index and
keep it alive during the user session. So this means for 100 active users,
there will be 100 connections from TransportClient to ES Cluster. I don't
have a reason why I have 100 instances of TransportClient has to be
initialized and kept in memory. Not sure if a singleton would unnecessarily
bring thread locks.
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.