Apache::DBI - consistently encountering about a .00667% error rate
Tim Lank <[email protected]> Mon, 7 Oct 2024 17:55:37 -0400
| Newsgroups | gmane.comp.apache.mod-perl |
|---|---|
| Message-ID | <CAHyifnRm37op4Woj_s8_jXxqpJVPWYjDgbm7n=Wu882tdAXQ4Q@mail.gmail.com> |
--000000000000674edb0623ea1590
Content-Type: text/plain; charset="UTF-8"
Apache::DBI experts:
I have the following in my startup.pl:
use CGI qw(:all);
use CGI::Carp 'fatalsToBrowser', 'carpout';
use List::Util 'shuffle';
CGI->compile(':all');
Apache::DBI->connect_on_init
("DBI:mysql:holidayshop",
"dba",
"theactualpw",
{
PrintError => 1, # warn() on errors
RaiseError => 0, # don't die on error
AutoCommit => 1, # commit executes immediately
}
);
$Apache::DBI::DEBUG = 0;
1;
mysql> SHOW VARIABLES LIKE 'wait_%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 300 | (I have set this to 172800 as well, but it
somehow doesn't stick)
+---------------+-------+
1 row in set (0.01 sec)
mysql> SHOW global VARIABLES LIKE 'wait_%';
+---------------+--------+
| Variable_name | Value |
+---------------+--------+
| wait_timeout | 172800 |
+---------------+--------+
1 row in set (0.00 sec)
mysql> SHOW session VARIABLES LIKE 'wait_%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 300 | (I have set this to 172800 as well, but it
somehow doesn't stick)
+---------------+-------+
1 row in set (0.00 sec)
I am load testing by sending about 300 page requests that utilize the
database every minute or so for the period of an hour.
Consistently I see about 6-8 occurrences of the following error in my
Apache error log for the hour no matter what I seem to do:
-e: DBI connect('holidayshop','dba',...) failed: Authentication plugin
'mysql_native_password' cannot be loaded: not initialized at
/var/www/holidayshop/perl/validatephone.pl line 16.
The actual line #16 in the code is:
my $logdb = DBI->connect('DBI:mysql:holidayshop', 'dba', 'theactualpw');
Hundreds of thousands of connections occur either outright or out of cache
without error and work just fine. The only problem is these 6-8 errors in
the log.
Can someone clue me in on what to do in order to try and eliminate any of
the errors from happening when doing a load test like this?
Server Version: Apache/2.4.57 (AlmaLinux) OpenSSL/3.0.7 mod_perl/2.0.12
Perl/v5.32.1Server MPM: eventServer version: 8.0.39 MySQL Community Server
- GPL
Thanks,Tim
--000000000000674edb0623ea1590
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Apache::DBI experts:</div><div><br></div><div>I have =
the following in my <a href=3D"http://startup.pl">startup.pl</a>:</div><div=
><br></div><div>use CGI qw(:all);<br>use CGI::Carp 'fatalsToBrowser'=
;, 'carpout';<br>use List::Util 'shuffle';<br>CGI->compi=
le(':all');<br>Apache::DBI->connect_on_init<br>=C2=A0 ("DBI=
:mysql:holidayshop",<br>=C2=A0 =C2=A0 =C2=A0"dba",<br>=C2=A0=
=C2=A0 =C2=A0"theactualpw",<br>=C2=A0 =C2=A0 {<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0PrintError =3D> 1, # warn() on errors<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0RaiseError =3D> 0, # don't die on error<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0AutoCommit =3D> 1, # commit executes immediately<br>=C2=A0 =
=C2=A0 }<br>=C2=A0 );<br>$Apache::DBI::DEBUG =3D 0;<br>1;<br></div><div><br=
></div><div>mysql> SHOW VARIABLES LIKE 'wait_%';<br>+-----------=
----+-------+<br>| Variable_name | Value |<br>+---------------+-------+<br>=
| wait_timeout =C2=A0| 300 =C2=A0 |=C2=A0 =C2=A0 (I have set this to 172800=
as well, but it somehow doesn't stick)<br>+---------------+-------+<br=
>1 row in set (0.01 sec)<br><br>mysql> SHOW global VARIABLES LIKE 'w=
ait_%';<br>+---------------+--------+<br>| Variable_name | Value =C2=A0=
|<br>+---------------+--------+<br>| wait_timeout =C2=A0| 172800 |<br>+----=
-----------+--------+<br>1 row in set (0.00 sec)<br><br>mysql> SHOW sess=
ion VARIABLES LIKE 'wait_%';<br>+---------------+-------+<br>| Vari=
able_name | Value |<br>+---------------+-------+<br>| wait_timeout =C2=A0| =
300 =C2=A0 |=C2=A0 =C2=A0 =C2=A0
(I have set this to 172800 as well, but it somehow doesn't stick)<br>+-=
--------------+-------+<br>1 row in set (0.00 sec)<br></div><div><br></div>=
<div><br></div><div>I am load testing by sending about 300 page requests th=
at utilize the database every minute or so for the period of an hour.</div>=
<div><br></div><div>Consistently I see about 6-8 occurrences of the followi=
ng error in my Apache error log for the hour no matter what I seem to do:</=
div><div><br></div><div>=C2=A0-e: DBI connect('holidayshop','db=
a',...) failed: Authentication plugin 'mysql_native_password' c=
annot be loaded: not initialized at /var/www/holidayshop/perl/<a href=3D"ht=
tp://validatephone.pl">validatephone.pl</a> line 16.<br></div><div><br></di=
v><div>The actual line #16 in the code is:</div><div><br></div><div>my $log=
db =3D DBI->connect('DBI:mysql:holidayshop', 'dba', '=
;theactualpw');<br></div><div><br></div><div>Hundreds of thousands of c=
onnections occur either outright or out of cache without error and work jus=
t fine.=C2=A0 =C2=A0The only problem is these 6-8 errors in the log.</div><=
div><br></div><div>Can someone clue me in on what to do in order to try and=
eliminate any of the errors from happening when doing a load test like thi=
s?</div><div><br></div><div><dt style=3D"color:rgb(0,0,0);font-family:"=
;Times New Roman";font-size:medium">Server Version: Apache/2.4.57 (Alm=
aLinux) OpenSSL/3.0.7 mod_perl/2.0.12 Perl/v5.32.1</dt><dt style=3D"color:r=
gb(0,0,0);font-family:"Times New Roman";font-size:medium">Server =
MPM: event</dt><dt style=3D"color:rgb(0,0,0);font-family:"Times New Ro=
man";font-size:medium">Server version: 8.0.39 MySQL Community Server -=
GPL<br></dt><dt style=3D"color:rgb(0,0,0);font-family:"Times New Roma=
n";font-size:medium"><br></dt><dt style=3D"color:rgb(0,0,0);font-famil=
y:"Times New Roman";font-size:medium">Thanks,</dt><dt style=3D"co=
lor:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">Ti=
m</dt></div></div>
--000000000000674edb0623ea1590--