On 1/3/2013 3:02 PM, Benjamin, Roy wrote:
I currently create a new instance of HttpSolrServer for each update. It's 
convenient when sharding
over a hundred shards in a heavily threaded updating client.  How heavy is this 
class?  Would
it really be worth using a pool (map of pools really) to hold on to previously 
created instances?

Each Solr core should have *one* HttpSolrServer instance for your entire application, and it can be static if necessary. It is reusable and entirely thread-safe. I don't know how heavy it is, but it does build its own HttpClient, and HttpClient in turn creates who knows how many additional objects.

It *might* be possible to have one server instance for each host/port combination with multiple cores and use query.setRequestHandler to pick which core you want, but I have not tested this theory. I've added it to my never-ending TODO list.

A note about using this mailing list: Please don't reply to an existing message when you want to create a new thread. You must create a brand new message and address it to solr-user@lucene.apache.org. When you reply to an existing message, message threading headers cause your message to appear as part of the original thread, and knowledgeable people who are uninterested in the original thread might never see your message. This is even more likely to happen to people who follow this mailing list on web-based forums that link to the mailing list.

Thanks,
Shawn

Reply via email to