I am writing a web app that will be hitting a SOLR server frequently. I plan to create multiple instances of this SOLR server so that one specific server doesn’t get hit too much. What’s the best way to load balance this?
I was thinking of creating a Redis store that would store the number of current requests per SOLR server, and querying on this store to get the SOLR server with the least # of current requests. Of course, I would update this store everytime a request is done.
Is this the best approach? What would you do in this situation?
I’m guessing you already set up Solr replication. Now, since Solr is a standard HTTP application, you can use any generic HTTP load balancer, such as HAProxy or Varnish. See this article on setting up HAProxy with Solr.