[KinoSearch] kinosearch and a mod perl web-app

Dan Chicot dan.chicot at gmail.com
Thu Oct 19 14:49:22 PDT 2006


Hello,

I'm using a KinoSearch index as part of a mod-perl web-app.  I'm attempting
to cache the searcher to improve performance - and it does.  However, when I
have load tested the application, after a few minutes of faultless execution
the script starts to throw the error detailed below.  It's the
fetch_hit_hashref that throws the error.  I'm caching the searcher by
putting a

use Smart::Search();

in the server startup scripts

and

$Smart::Search::Searcher = KinoSearch::Searcher->new(
        invindex => '/data01/index',
        analyzer => KinoSearch::Analysis::PolyAnalyzer->new(language =>
'en')
    );

in the outermost scope of the perl module file that has the search
function.  The search is then conducted thus: -

sub search {
   ...
  my $hits = $Smart::Search::Searcher->search(query => $query);
  ...
  while (my $hit = $hits->fetch_hit_hashref) {
     ....
  }
}

My guess is that the problem occurs when 2 threads use the searcher
simultaneously.  So, I suppose my question is: Should I be taking steps to
lock the searcher prior to use? and,  is there an example of how to
correctly cache a searcher somewhere that I might learn from,

The facts: -
KinoSearch 0.13
Perl            5.8.8
Suse Linux 10.1
linux kernel 2.6.16
gcc             4.1.0
mod_perl    2.02-14
apache2-prefork 2.2.0-21.7

The error: -
[Thu Oct 19 21:51:51 2006] [error] refill: tried to read 1024 bytes, got 0:
25 at
/usr/lib/perl5/site_perl/5.8.8/i586-linux-thread-multi/KinoSearch/Index/FieldsReader.pm
line 54

KinoSearch::Index::FieldsReader::fetch_raw('KinoSearch::Index::FieldsReader=HASH(0x806bf584)',
171) called at
/usr/lib/perl5/site_perl/5.8.8/i586-linux-thread-multi/KinoSearch/Index/FieldsReader.pm
line 68

KinoSearch::Index::FieldsReader::fetch_doc('KinoSearch::Index::FieldsReader=HASH(0x806bf584)',
171) called at
/usr/lib/perl5/site_perl/5.8.8/i586-linux-thread-multi/KinoSearch/Index/SegReader.pm
line 179

KinoSearch::Index::SegReader::fetch_doc('KinoSearch::Index::SegReader=HASH(0x8055b560)',
171) called at
/usr/lib/perl5/site_perl/5.8.8/i586-linux-thread-multi/KinoSearch/Search/Hit.pm
line 22

KinoSearch::Search::Hit::get_doc('KinoSearch::Search::Hit=HASH(0x8078183c)')
called at
/usr/lib/perl5/site_perl/5.8.8/i586-linux-thread-multi/KinoSearch/Search/Hit.pm
line 29

KinoSearch::Search::Hit::get_field_values('KinoSearch::Search::Hit=HASH(0x8078183c)')
called at
/usr/lib/perl5/site_perl/5.8.8/i586-linux-thread-multi/KinoSearch/Search/Hits.pm
line 92

KinoSearch::Search::Hits::fetch_hit_hashref('KinoSearch::Search::Hits=HASH(0x803fe064)')
called at /srv/www/perl-lib/Smart/Search.pm line 76

Smart::Search::group_by_proceeding('KinoSearch::Search::Hits=HASH(0x803fe064)')
called at /srv/www/perl-lib/Smart/Search.pm line 34
        Smart::Search::run('HASH(0x804206f8)') called at
/srv/www/cgi-bin/trawlcit.pl line 9

ModPerl::ROOT::ModPerl::Registry::srv_www_cgi_2dbin_trawlcit_2epl::handler('Apache2::RequestRec=SCALAR(0x80762090)')
called at
/usr/lib/perl5/vendor_perl/5.8.8/i586-linux-thread-multi/ModPerl/RegistryCooker.pm
line 203
        eval {...} called at
/usr/lib/perl5/vendor_perl/5.8.8/i586-linux-thread-multi/ModPerl/RegistryCooker.pm
line 203
        ModPerl::RegistryCooker::run('ModPerl::Registry=HASH(0x807848f4)')
called at
/usr/lib/perl5/vendor_perl/5.8.8/i586-linux-thread-multi/ModPerl/RegistryCooker.pm
line 169

ModPerl::RegistryCooker::default_handler('ModPerl::Registry=HASH(0x807848f4)')
called at
/usr/lib/perl5/vendor_perl/5.8.8/i586-linux-thread-multi/ModPerl/Registry.pm
line 30
        ModPerl::Registry::handler('ModPerl::Registry',
'Apache2::RequestRec=SCALAR(0x80762090)') called at -e line 0
        eval {...} called at -e line 0

Any help greatly appreciated

Thank you

Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rectangular.com/pipermail/kinosearch/attachments/20061019/9ddddf41/attachment-0001.htm 
-------------- next part --------------
_______________________________________________
KinoSearch mailing list
KinoSearch at rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch


More information about the kinosearch mailing list