This is a cool idea, and there are two extremes to consider. One-shard, N replicas, single connection point for consumers. This case needs forwarding.
Many shards, 2 replicas each, random connection points for consumers. I think this is the case that SG had in mind. In order to meet both use cases, would it make sense to have a "prefer local reads" configuration option where a Core can check itself if instructed to? Mike On Wed, Dec 10, 2014 at 8:26 AM, Erick Erickson <erickerick...@gmail.com> wrote: > Just skimming, but if I'm reading this right, your suggestion is > that queries be served locally rather than being forwarded to > another replica when possible. > > So let's take the one-shard case with N replicas to make sure > I understand. In a one-shard case, no query really needs to > be forwarded, since any replica can fully get the results so > in this case no query would be forwarded. > > If this is a fair summary, then consider the situation where the > outside world connects to a single server rather than to a > fronting load balancer. Then only one shard would be doing > any work.... > > Or am I off in the weeds? > > That aside, if I've gotten it wrong and you want to put > up a patch (or even just outline a better approach), > feel free to open a JIRA and attach a patch... > > Best, > Erick > > On Tue, Dec 9, 2014 at 11:55 PM, S G <sg.online.em...@gmail.com> wrote: > > Hello Solr Devs, > > > > I am a developer using Solr and wanted to have some opinion on a > performance > > change request. > > > > Currently, I see that code flow for a query in SolrCloud is as follows: > > > > For distributed query: > > SolrCore -> SearchHandler.handleRequestBody() -> > HttpShardHandler.submit() > > > > For non-distributed query: > > SolrCore -> SearchHandler.handleRequestBody() -> QueryComponent.process() > > > > > > For a distributed query, the request is always sent to all the shards > even > > if the originating SolrCore (handling the original distributed query) is > a > > replica of one of the shards. > > If the original Solr-Core can check itself before sending http requests > for > > any shard, we can probably save some network hopping and gain some > > performance. > > > > If this idea seems feasible, I can submit a JIRA ticket and work on it. > > I am planning to change SearchHandler.handleRequestBody() or > > HttpShardHandler.submit() > > > > Thanks > > SG > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org > For additional commands, e-mail: dev-h...@lucene.apache.org > >