Skip to main content.
home | support | download

Back to List Archive

Re: SWISH::API::Stat

From: Peter Karman <peter(at)not-real.peknet.com>
Date: Tue Nov 07 2006 - 02:32:15 GMT
Brad Miele scribbled on 11/6/06 8:18 PM:
> Peter, a few questions,
> 
> use SWISH::API::Stat;
>          my $swish = SWISH::API::Stat->new(
>                            log             => $filehandle,
>                            indexes         => [ 'path/to/index' ],
>                            paranoia_level  => 1
>                            );
> 
> 
> is log needed? I am pretty cautious about how much logging i do on my 
> production boxes, a bare minimum is the rule...
> 

read SWISH::API::More:

"Set to 0 to disable the default (but then don't expect logger() to work...)."

If you don't disable the log() feature of S::A::S, it will print a timestamped 
message to stderr every time it reconnects, but that's about it.

> currently, we scp the indexes into and incoming folder, mv them into 
> place, and reload apache. This worked for a while, but as our volume of 
> searches has increased, this is where we end up with stale index 
> filehandles and evergrowing httpd processes, so now we apachectl stop; 
> mv index; apachectl start; With SWISH::API::Stat, do you recommend a 
> reload after the indexes are copied into place?
> 

You should not need to touch apache; that's the whole point of S::A::S. You can 
just mv your indexes into place, and the next time $swish_handle tries to access 
them, it should detect they've changed, and a new handle will be created.

However, if you httpd processes are growing wildly, you may have a memory leak 
somewhere in your code (i.e., a Perl object that never gets destroyed because a 
reference to it persists somewhere). See the mod_perl docs about how to run 
under a debugger and a memory profiler.


-- 
Peter Karman  .  http://peknet.com/  .  peter(at)not-real.peknet.com
Received on Mon Nov 6 18:32:15 2006