DBI Ocassionally hangs
am 01.08.2006 12:04:39 von StephenI'm having weird problem with DBI and DBD::Oracle and DBD::Sqlrelay.
SQL statements that normally complete in milliseconds will suddenly hang
until an alarm interrupts them. For example The following will get run
about 20,000 times in a normal day:
select count(*) from webuserparm where usercd = 'PASSWORD' and cltid = 12345
Usually it completes in about 10 ms but once in a while I'll get a
cluster of 3 to 6 timeouts where the above will not complete in 3 to 15
seconds and gets interrupted by the alarm. These usually happen in
clusters and it makes no difference I can measure whether I use
connection pooling thru sqlrelay or make a new connection via
DBD::Oracle each time.
use strict;
use warnings;
use DBI;
use Sys::SigAction qw (set_sig_handler);
..
..
..
$sth = $edi_dbh->prepare($script);
$cntr = 1; # will be set to 0 on error in eval
eval {
my $h = set_sig_handler('ALRM',
sub {$cntr = 0; die;},
{ mask=>[qw(INT ALRM)],safe => 1 } );
alarm($timeout);
$sth->execute();
alarm(0);
};
I'm using
Perl v 5.8.X
DBI 1.40 (also tried 1.50 but not in production yet)
DBD::Oracle 1.17 or DBD::SqlRelay 0.37
Sys::SigAction 0.04
I'm not pointing a finger at DBI. I'm just trying to find out if it may
be a cause. Maybe some bug I didn't read about in the archives.
--
Stephen Carville
Unix and Network Admin
Nationwide Totalflood
6033 W. Century Blvd
Los Angeles, CA 90045
310-342-3602