Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 10F68200B41 for ; Thu, 7 Jul 2016 16:35:40 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0FA4B160A68; Thu, 7 Jul 2016 14:35:40 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 30AFF160A4F for ; Thu, 7 Jul 2016 16:35:39 +0200 (CEST) Received: (qmail 20573 invoked by uid 500); 7 Jul 2016 14:35:38 -0000 Mailing-List: contact blur-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: blur-user@incubator.apache.org Delivered-To: mailing list blur-user@incubator.apache.org Received: (qmail 20561 invoked by uid 99); 7 Jul 2016 14:35:38 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jul 2016 14:35:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id B4C27C63ED for ; Thu, 7 Jul 2016 14:35:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.198 X-Spam-Level: * X-Spam-Status: No, score=1.198 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id BId9EotRpa8y for ; Thu, 7 Jul 2016 14:35:35 +0000 (UTC) Received: from mail-vk0-f48.google.com (mail-vk0-f48.google.com [209.85.213.48]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id D5C1C5F1B3 for ; Thu, 7 Jul 2016 14:35:34 +0000 (UTC) Received: by mail-vk0-f48.google.com with SMTP id b192so22597702vke.0 for ; Thu, 07 Jul 2016 07:35:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=BoT3oljBXrwegsN1Y7t9zo0CbJMh3vk7sVSm5/j9qSs=; b=ghvgwEzIXEHBlrAvKEtlPGlDcU5GvkHfC2F+QydK9jJceg1I2BpZoah4iWRCGmjQXa ypwOUAFtN9KLuudxy/6WgR/Y5mUfamXIn+kGw2mJ2J7GkgTKXDKVJSjken9OmXuNhInV iEzFreaoWSYmT3inOoYvTfsEQbZ+T+zN5EsDBoKzLhR1XWG9+ISrHBtagZ64vkl1wbzy d7Zgx2aFcc0nrLDJ36+IBLqbOYRsgTgrBShILBc0xMAkxo7RA5kZRD99S7MArF4mNKE1 xxMByV1E7tLZyWeYD0s//9EtkE+n0ulO6gzpwRW5p5Cz01Es2YeHePIszHMYg8zyp7Uv +Ayw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=BoT3oljBXrwegsN1Y7t9zo0CbJMh3vk7sVSm5/j9qSs=; b=Ekp+Lq1arsWPw8He5b++yrwBObVxWp76ZXGvIwtjvGyyfh4HxenOZOrVFngW6KQWI/ Db5m8h2+mjcxgR+DjUeTFZjoVvO4Jcb8HB6p6bLqU8V+QLekWr4gm1PynUIyXVsm2JNI fmuo2pLGkHWnZmXim5KQupIvFdCPwBtBq1QXBxcO7dQ9Z/Z60QNv6lIDCWzBBYWVaGnQ 7baoPzL9RHneIO9K9Lif4X0vxZTeWpp3F8cyf0oEexnX8K6g1ZnTK8vEwKwJub36mC4k YUJ5h1KP3kF8TBZemCwiZzKcjVjR/JJnRRgCjQOuKrKKKU9d3QCq6fsLFKXJ7tHFXSfu GRaQ== X-Gm-Message-State: ALyK8tKaCAkunxHGU7U0iSZHHcvvSU1hZoR+kg0d/v8GsjRFHAdD9OyQA0P+5n9aHzGT+RtcG/kq8diLasPj8A== X-Received: by 10.176.5.161 with SMTP id e30mr259348uae.92.1467902127633; Thu, 07 Jul 2016 07:35:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.3.66 with HTTP; Thu, 7 Jul 2016 07:35:27 -0700 (PDT) In-Reply-To: References: From: Aaron McCurry Date: Thu, 7 Jul 2016 10:35:27 -0400 Message-ID: Subject: Re: Help needed on SearchExecutor... To: "blur-user@incubator.apache.org" Content-Type: multipart/alternative; boundary=94eb2c1245b6e1ff9d05370c983e archived-at: Thu, 07 Jul 2016 14:35:40 -0000 --94eb2c1245b6e1ff9d05370c983e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Yeah I think that would work. On Thu, Jul 7, 2016 at 9:58 AM, Ravikumar Govindarajan < ravikumar.govindarajan@gmail.com> wrote: > I just now looked at IndexSearcherCloseableSecureBase.java > > Guess if we want to cap each search request with max-of "n" threads, we c= an > plug the above logic into this class directly instead of > BlurIndexSimpleWriter.java > > On Wed, Jun 29, 2016 at 6:04 PM, Ravikumar Govindarajan < > ravikumar.govindarajan@gmail.com> wrote: > > > This is really nice Aaron. You've done the bulk of work already!!! > > > > I think parallelism can be provided too for searching a single shard...= . > > > > Just as a quick proposal, we can do a static initialization in > > BlurIndexSimpleWriter > > > > static LinkedBlockingQueue executorQueue =3D new LBQ(128/4); > > > > static { > > for(int i=3D0;i<128/4;i++) { > > queue.add(Executors.newFixedThreadPool(4)); > > } > > } > > ---- > > > > Incoming search request per-shard... > > > > public IndexSearcher getIndexSearcher() { > > ..... > > Executor current =3D executorQueue.poll(); > > > > if (current=3D=3Dnull) { > > //All thread-pools are busy or user has explicitly switched off via > > config. > > //Search proceeds in single threaded fashion utilizing calling-thread > > itself > > } > > > > return new IndexSearcherCloseable(indexReader, current); > > } > > --- > > > > Btw, we can do this by over-riding a single method > > IndexSearcher.slices(...) in lucene 5.x & above!!! > > > > > > On Tue, Jun 28, 2016 at 8:01 PM, Aaron McCurry > wrote: > > > >> Some time ago I created something similar, it's kinda a backport into > >> Lucene 4.3: > >> > >> > >> > https://github.com/apache/incubator-blur/blob/65640200a8e7dd539c1dd4d9202= 55c717102b9b2/blur-query/src/main/java/org/apache/blur/lucene/search/Clonea= bleCollector.java#L25 > >> > >> It's handles the execution of searching the segments in parallel but > >> doesn't provide any limitations on parallelism. > >> > >> Aaron > >> > >> > >> > >> On Tue, Jun 28, 2016 at 6:37 AM, Ravikumar Govindarajan < > >> ravikumar.govindarajan@gmail.com> wrote: > >> > >> > Aaron, > >> > > >> > Just an update.. > >> > > >> > https://issues.apache.org/jira/browse/LUCENE-5299 > >> > > >> > You can now use any collector & get guaranteed parallel execution. > They > >> > have also provided a "parallelism" hint that will limit the number o= f > >> > search threads at request level... > >> > > >> > i.e., we can fix blur executor thread-count at 128 & limit > >> "parallelism" at > >> > a max of 4 threads per request.. > >> > > >> > On Fri, Feb 6, 2015 at 5:25 PM, Ravikumar Govindarajan < > >> > ravikumar.govindarajan@gmail.com> wrote: > >> > > >> > > Thanks for the clarifications. > >> > > > >> > > Another point I thought about is the disk efficiency of a serving = a > >> > > random-IO. Many parallel threads could end-up hitting just one or > two > >> > disks > >> > > in the cluster=E2=80=A6 > >> > > > >> > > Think I can skip it safely for my work-loads. > >> > > > >> > > -- > >> > > Ravi > >> > > > >> > > On Fri, Feb 6, 2015 at 3:09 PM, Aaron McCurry > >> > wrote: > >> > > > >> > >> The ServiceExecutor (thread pool) put inside the IndexSearcher wa= s > an > >> > >> attempt at making the segments search in parallel when available. > >> > However > >> > >> there is a limitation in Lucene that does not allow segment > parallel > >> > >> searches when you are using Collectors. > >> > >> > >> > >> > >> > >> > >> > > >> > https://github.com/apache/lucene-solr/blob/lucene_solr_4_3_0/lucene/core/= src/java/org/apache/lucene/search/IndexSearcher.java#L595 > >> > >> > >> > >> We override this method to allow for Tracing: > >> > >> > >> > >> > >> > >> > >> > > >> > https://github.com/apache/incubator-blur/blob/master/blur-core/src/main/j= ava/org/apache/blur/server/IndexSearcherCloseableBase.java#L46 > >> > >> > >> > >> and here: > >> > >> > >> > >> > >> > >> > >> > > >> > https://github.com/apache/incubator-blur/blob/master/blur-core/src/main/j= ava/org/apache/blur/server/IndexSearcherCloseableSecureBase.java#L51 > >> > >> > >> > >> I agree that if you are already running a lot of shards per serve= r > >> that > >> > if > >> > >> we were to enhance Lucene to allow for parallel searching of > >> segments it > >> > >> could become counter productive. I have seen underutilized syste= ms > >> that > >> > >> could take advantage of the parallel segment search, so as with a= ny > >> > >> feature > >> > >> like this, it depends. :-) > >> > >> > >> > >> Aaron > >> > >> > >> > >> On Fri, Feb 6, 2015 at 2:39 AM, Ravikumar Govindarajan < > >> > >> ravikumar.govindarajan@gmail.com> wrote: > >> > >> > >> > >> > Blur by default uses a SearchExecutor for IndexSearcher. I > believe > >> > >> lucene > >> > >> > helps searching segments of a single shard in parallel. > >> > >> > > >> > >> > Our previous index was built on a lower version of lucene where > >> such a > >> > >> > feature was absent and we ran sequential search per shard only= =E2=80=A6 > >> > >> > > >> > >> > What is the general recommendation for blur? Is it advisable to > use > >> > the > >> > >> > SearchExecutor? What will happen when there are many parallel > >> queries > >> > >> for > >> > >> > different shards. Will SearchExecutor become a bottle-neck? > >> > >> > > >> > >> > Any help is much appreciated... > >> > >> > > >> > >> > -- > >> > >> > Ravi > >> > >> > > >> > >> > >> > > > >> > > > >> > > >> > > > > > --94eb2c1245b6e1ff9d05370c983e--