On 5/30/2022 12:30 AM, Clemens WYSS (Helbling Technik) wrote:
As you can see
* we keep one SolrClient-connection per core in a map and make use of these
connections
* making use of HttpSolrClient ( Http2SolrClient is denoted "experimental" and
has cause some problem )
* no special tweaking of underneath HttpClient
Any reason for this minimal setup not being able to stem many many concurrent
requests? What is the proposed SolrJ based solr client setup (for a single Solr
server)?
Vincenzo is correct. Used properly, the solr clients are thread-safe
and designed to handle concurrent connections.
You actually only need one HttpSolrClient per Solr instance (host/port
combination), not one for every core. When you make a request to Solr
via a SolrClient, you can tell it what core/collection should receive
the request. As long as the number of cores isn't enormous, having a
client per core is not likely to cause issues. Just something for you
to think about the next time you are ready to do a major code revision.
What version of SolrJ are you using in your code? For a long time,
SolrJ defaulted to an HttpClient that only allowed two threads per
destination. Then that was greatly increased. Now from what I can
decipher in current 8.x code using the Builder, we may be back to a
default of two connections per destination, which is NOT a good thing
when concurrency is expected.
Looking at HttpSolrClientBuilder, I do not see a way to specify a custom
http client. Anyone know how that can be done?
Thanks,
Shawn