Return-Path: X-Original-To: apmail-lucy-user-archive@www.apache.org Delivered-To: apmail-lucy-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 62E80D1C5 for ; Mon, 22 Oct 2012 16:50:15 +0000 (UTC) Received: (qmail 97945 invoked by uid 500); 22 Oct 2012 16:50:15 -0000 Delivered-To: apmail-lucy-user-archive@lucy.apache.org Received: (qmail 97893 invoked by uid 500); 22 Oct 2012 16:50:14 -0000 Mailing-List: contact user-help@lucy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@lucy.apache.org Delivered-To: mailing list user@lucy.apache.org Received: (qmail 97884 invoked by uid 99); 22 Oct 2012 16:50:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2012 16:50:14 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dag@nimrod.no designates 195.139.160.2 as permitted sender) Received: from [195.139.160.2] (HELO sid.nimrod.no) (195.139.160.2) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2012 16:50:09 +0000 Received: from sid.nimrod.no (localhost.localdomain [127.0.0.1]) by sid.nimrod.no (8.13.8/8.13.8) with ESMTP id q9MGnlGS019706 for ; Mon, 22 Oct 2012 18:49:47 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nimrod.no; s=n20120428; t=1350924587; i=@nimrod.no; bh=Z7JPnMFWoC1qGKPZfQ9KXlSWo87U+E59++U3RSkMFPM=; h=Sender:To:Subject:References:From:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=eexMml6JvmpQZJII31ZYvmsmrqeA3m7WX80jCb2kA43ckNc3RWMTE90xPwNGVQm7h fXSRb+ebQWB0xU6Gku2KNhQtU0pSguGQOTFugjzH/Pe7cuEuqW8uTzHLNIys+KK1WH aar5tPURRfHrAtAlq1ucONvUV05JAnRNpt/qPVxg= Received: (from dag@localhost) by sid.nimrod.no (8.13.8/8.13.8/Submit) id q9MGnlBW019703; Mon, 22 Oct 2012 18:49:47 +0200 X-Authentication-Warning: sid.nimrod.no: dag set sender to dag@nimrod.no using -f Sender: dag@nimrod.no To: user@lucy.apache.org References: <86r4oqa6da.fsf@sid.nimrod.no> From: Dag Lem Organization: Nimrod Date: 22 Oct 2012 18:49:47 +0200 In-Reply-To: <86r4oqa6da.fsf@sid.nimrod.no> Message-ID: <867gqijvtg.fsf@sid.nimrod.no> Lines: 73 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [lucy-user] SearchServer / ClusterSearcher - massive performance hit Dag Lem writes: [...] > I have attached a small test program, which only uses one shard to > demonstrate the problem. Provided an available index and appropriate > modification to the hard coded query, the program can be run as > ./test_shard.pl to test SearchServer / ClusterSearcher, and as > ./test_shard.pl 0 to test IndexSearcher on the same index. BTW, my > index contains about 5 million documents. [...] My attachment seems to have been dropped; please find the test program below. -- Best regards, Dag Lem #!/usr/bin/perl use strict; use warnings; use Lucy::Search::IndexSearcher; use LucyX::Remote::SearchServer; use LucyX::Remote::ClusterSearcher; $SIG{CHLD} = "IGNORE"; # Pass 0 to test normal search. my $cluster = !@ARGV || $ARGV[0] eq '1'; my $searcher = Lucy::Search::IndexSearcher->new(index => "/db/disk1/lucy/full"); my $schema = $searcher->get_schema(); if ($cluster) { if (fork() == 0) { # Start server in child process. my $search_server = LucyX::Remote::SearchServer->new(searcher => $searcher); $search_server->serve(port => "8000"); exit; } # Give server some time to start up. sleep(1); $searcher = LucyX::Remote::ClusterSearcher->new( schema => $schema, shards => [ "localhost:8000" ], ); } my $query_parser = Lucy::Search::QueryParser->new(schema => $schema); $query_parser->set_heed_colons(1); for (1..10000) { my $q = $query_parser->parse("fornavn:(dag) AND etternavn:(lem)"); my $hits = $searcher->hits( query => $q, offset => 0, num_wanted => 100, ); # while (my $hit = $hits->next) { # print "$hit->{fodselsdato}\t$hit->{navn}\n"; # } } # Stop server. $searcher->terminate() if $cluster;