Subject: | Please fix - big timeout in new method (Sphinx::Search) |
Date: | Thu, 7 May 2009 01:56:39 +0600 |
To: | bug-Sphinx-Search [...] rt.cpan.org |
From: | Perlover <perlover [...] perlover.com> |
Hello!
Thanks for nice module
But there is bad moment
Your 'new' method uses $Config{longsize} for default options
%Config - tied hash, and first time execution of new method -
'require'-ing Config_heavy.pl file by AUTOLOAD method
I use apache with your module and noticed that sometimes i have 10-30
seconds delay for one query to Sphinx (many queries do 0.001 - 0.3 sec
for example)
Now i know there trouble. I used my logging for profile info and found
that first time of running Sphinx::Search->new take a long time.
Apache processes have a limited time of life and i have many delayed
search request from users ....
I suggest to you in module use like this:
use IO::Socket::UNIX;
use Encode qw/encode_utf8 decode_utf8/;
$Config{longsize};
...
I think this will be work fine - "use Sphinx::Search" will preload
%Config tied methods and first time execution of new method will be
work quickly
Alexey aka Perlover :)