Re: Apache::DBI - consistently encountering about a .00667% error rate

Tim Lank <[email protected]> Mon, 7 Oct 2024 19:28:00 -0400
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CAHyifnQq9miSibU9vqXOOzoLFScx5QZfsL74C1OL4xBpm284Ow@mail.gmail.com>
--000000000000d67fc70623eb5f04
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Good point.  I=E2=80=99ll try to ratchet up the debugs on those to see if a=
nything
pops out

On Mon, Oct 7, 2024 at 6:58=E2=80=AFPM Adam Prime <[email protected]=
.ca>
wrote:

> You may need to dig into the code in DBI, or DBD::mysql to understand wha=
t
> is happening (or not happening) in the rare occasions that this occurs.
> Without the ability to consistently reproduce the issue all we can really
> do is look at the code and make educated guesses.
>
> Adam
>
> On Oct 7, 2024, at 5:56=E2=80=AFPM, Tim Lank <[email protected]> wrote:
>
> =EF=BB=BF
>
> You don't often get email from [email protected]. Learn why this is
> important <https://aka.ms/LearnAboutSenderIdentification>
>
> 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 =3D> 1, # warn() on errors
>        RaiseError =3D> 0, # don't die on error
>        AutoCommit =3D> 1, # commit executes immediately
>     }
>   );
> $Apache::DBI::DEBUG =3D 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 =3D DBI->connect('DBI:mysql:holidayshop', 'dba', 'theactualpw')=
;
>
> Hundreds of thousands of connections occur either outright or out of cach=
e
> 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
>
>

--000000000000d67fc70623eb5f04
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto">Good point.=C2=A0 I=E2=80=99ll try to ratchet up the debu=
gs on those to see if anything pops out</div><div><br><div class=3D"gmail_q=
uote"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, Oct 7, 2024 at 6:58=E2=
=80=AFPM Adam Prime &lt;<a href=3D"mailto:[email protected]">adam=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_=
quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1=
ex">



<div dir=3D"auto">
<div dir=3D"ltr"></div>
<div dir=3D"ltr">You may need to dig into the code in DBI, or DBD::mysql to=
 understand what is happening (or not happening) in the rare occasions that=
 this occurs. Without the ability to consistently reproduce the issue all w=
e can really do is look at the code
 and make educated guesses.=C2=A0</div>
<div dir=3D"ltr"><br>
</div>
<div dir=3D"ltr">Adam</div>
<div dir=3D"ltr"><br>
<blockquote type=3D"cite">On Oct 7, 2024, at 5:56=E2=80=AFPM, Tim Lank &lt;=
<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
m</a>&gt; wrote:<br>
<br>
</blockquote>
</div>
<blockquote type=3D"cite">
<div dir=3D"ltr">=EF=BB=BF
<table border=3D"0" cellspacing=3D"0" cellpadding=3D"0" width=3D"100%" styl=
e=3D"background:revert!important;border:revert!important;color:revert!impor=
tant;direction:revert!important;display:revert!important;font-size:revert!i=
mportant;height:revert!important;letter-spacing:revert!important;line-heigh=
t:revert!important;margin:revert!important;opacity:revert!important;outline=
:revert!important;overflow:revert!important;padding:revert!important;table-=
layout:revert!important;text-align:revert!important;text-indent:revert!impo=
rtant;text-orientation:revert!important;text-overflow:revert!important;text=
-transform:revert!important;vertical-align:revert!important;white-space:rev=
ert!important;width:revert!important;word-break:revert!important;word-spaci=
ng:revert!important;writing-mode:revert!important;zoom:revert!important;bor=
der:0!important;display:table!important;width:100%!important;table-layout:f=
ixed!important;border-collapse:seperate!important;float:none!important;bord=
er-spacing:0px 0px!important" align=3D"left">
<tbody style=3D"background:revert!important;border:revert!important;color:r=
evert!important;direction:revert!important;display:revert!important;font-si=
ze:revert!important;height:revert!important;letter-spacing:revert!important=
;line-height:revert!important;margin:revert!important;opacity:revert!import=
ant;outline:revert!important;overflow:revert!important;padding:revert!impor=
tant;table-layout:revert!important;text-align:revert!important;text-indent:=
revert!important;text-orientation:revert!important;text-overflow:revert!imp=
ortant;text-transform:revert!important;vertical-align:revert!important;whit=
e-space:revert!important;width:revert!important;word-break:revert!important=
;word-spacing:revert!important;writing-mode:revert!important;zoom:revert!im=
portant;display:block!important">
<tr style=3D"background:revert!important;border:revert!important;color:reve=
rt!important;direction:revert!important;display:revert!important;font-size:=
revert!important;height:revert!important;letter-spacing:revert!important;li=
ne-height:revert!important;margin:revert!important;opacity:revert!important=
;outline:revert!important;overflow:revert!important;padding:revert!importan=
t;table-layout:revert!important;text-align:revert!important;text-indent:rev=
ert!important;text-orientation:revert!important;text-overflow:revert!import=
ant;text-transform:revert!important;vertical-align:revert!important;white-s=
pace:revert!important;width:revert!important;word-break:revert!important;wo=
rd-spacing:revert!important;writing-mode:revert!important;zoom:revert!impor=
tant">
<td valign=3D"middle" width=3D"1px" bgcolor=3D"#A6A6A6" cellpadding=3D"7px =
2px 7px 2px" style=3D"background:revert!important;border:revert!important;c=
olor:revert!important;direction:revert!important;display:revert!important;f=
ont-size:revert!important;height:revert!important;letter-spacing:revert!imp=
ortant;line-height:revert!important;margin:revert!important;opacity:revert!=
important;outline:revert!important;overflow:revert!important;padding:revert=
!important;table-layout:revert!important;text-align:revert!important;text-i=
ndent:revert!important;text-orientation:revert!important;text-overflow:reve=
rt!important;text-transform:revert!important;vertical-align:revert!importan=
t;white-space:revert!important;width:revert!important;word-break:revert!imp=
ortant;word-spacing:revert!important;writing-mode:revert!important;zoom:rev=
ert!important;padding:7px 2px 7px 2px!important;background-color:#a6a6a6!im=
portant;width:0px!important">
</td>
<td valign=3D"middle" width=3D"100%" bgcolor=3D"#EAEAEA" cellpadding=3D"7px=
 5px 7px 15px" color=3D"#212121" style=3D"background:revert!important;borde=
r:revert!important;color:revert!important;direction:revert!important;displa=
y:revert!important;font-size:revert!important;height:revert!important;lette=
r-spacing:revert!important;line-height:revert!important;margin:revert!impor=
tant;opacity:revert!important;outline:revert!important;overflow:revert!impo=
rtant;padding:revert!important;table-layout:revert!important;text-align:rev=
ert!important;text-indent:revert!important;text-orientation:revert!importan=
t;text-overflow:revert!important;text-transform:revert!important;vertical-a=
lign:revert!important;white-space:revert!important;width:revert!important;w=
ord-break:revert!important;word-spacing:revert!important;writing-mode:rever=
t!important;zoom:revert!important;width:100%!important;background-color:#ea=
eaea!important;padding:7px 5px 7px 15px!important;font-family:wf_segoe-ui_n=
ormal,Segoe UI,Segoe WP,Tahoma,Arial,sans-serif!important;font-size:12px!im=
portant;font-weight:normal!important;color:#212121!important;text-align:lef=
t!important;word-wrap:break-word!important">
<div style=3D"background:revert!important;border:revert!important;color:rev=
ert!important;direction:revert!important;display:revert!important;font-size=
:revert!important;height:revert!important;letter-spacing:revert!important;l=
ine-height:revert!important;margin:revert!important;opacity:revert!importan=
t;outline:revert!important;overflow:revert!important;padding:revert!importa=
nt;table-layout:revert!important;text-align:revert!important;text-indent:re=
vert!important;text-orientation:revert!important;text-overflow:revert!impor=
tant;text-transform:revert!important;vertical-align:revert!important;white-=
space:revert!important;width:revert!important;word-break:revert!important;w=
ord-spacing:revert!important;writing-mode:revert!important;zoom:revert!impo=
rtant">
You don&#39;t often get email from <a href=3D"mailto:[email protected]" t=
arget=3D"_blank">[email protected]</a>. <a href=3D"https://aka.ms/LearnAb=
outSenderIdentification" style=3D"background:revert!important;color:revert!=
important;direction:revert!important;display:revert!important;font-size:rev=
ert!important;opacity:revert!important" target=3D"_blank">
Learn why this is important</a> </div>
</td>
<td valign=3D"middle" align=3D"left" width=3D"75px" bgcolor=3D"#EAEAEA" cel=
lpadding=3D"7px 5px 7px 5px" color=3D"#212121" style=3D"background:revert!i=
mportant;border:revert!important;color:revert!important;direction:revert!im=
portant;display:revert!important;font-size:revert!important;height:revert!i=
mportant;letter-spacing:revert!important;line-height:revert!important;margi=
n:revert!important;opacity:revert!important;outline:revert!important;overfl=
ow:revert!important;padding:revert!important;table-layout:revert!important;=
text-align:revert!important;text-indent:revert!important;text-orientation:r=
evert!important;text-overflow:revert!important;text-transform:revert!import=
ant;vertical-align:revert!important;white-space:revert!important;width:reve=
rt!important;word-break:revert!important;word-spacing:revert!important;writ=
ing-mode:revert!important;zoom:revert!important;width:75px!important;backgr=
ound-color:#eaeaea!important;padding:7px 5px 7px 5px!important;font-family:=
wf_segoe-ui_normal,Segoe UI,Segoe WP,Tahoma,Arial,sans-serif!important;font=
-size:12px!important;font-weight:normal!important;color:#212121!important;t=
ext-align:left!important;word-wrap:break-word!important">
</td>
</tr>
</tbody>
</table></div></blockquote></div><div dir=3D"auto"><blockquote type=3D"cite=
"><div dir=3D"ltr">
<div>
<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" target=3D"_bl=
ank">startup.pl</a>:</div>
<div><br>
</div>
<div>use CGI qw(:all);<br>
use CGI::Carp &#39;fatalsToBrowser&#39;, &#39;carpout&#39;;<br>
use List::Util &#39;shuffle&#39;;<br>
CGI-&gt;compile(&#39;:all&#39;);<br>
Apache::DBI-&gt;connect_on_init<br>
=C2=A0 (&quot;DBI:mysql:holidayshop&quot;,<br>
=C2=A0 =C2=A0 =C2=A0&quot;dba&quot;,<br>
=C2=A0 =C2=A0 =C2=A0&quot;theactualpw&quot;,<br>
=C2=A0 =C2=A0 {<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0PrintError =3D&gt; 1, # warn() on errors<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0RaiseError =3D&gt; 0, # don&#39;t die on error<b=
r>
=C2=A0 =C2=A0 =C2=A0 =C2=A0AutoCommit =3D&gt; 1, # commit executes immediat=
ely<br>
=C2=A0 =C2=A0 }<br>
=C2=A0 );<br>
$Apache::DBI::DEBUG =3D 0;<br>
1;<br>
</div>
<div><br>
</div>
<div>mysql&gt; SHOW VARIABLES LIKE &#39;wait_%&#39;;<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&#39;t stick)<br>
+---------------+-------+<br>
1 row in set (0.01 sec)<br>
<br>
mysql&gt; SHOW global VARIABLES LIKE &#39;wait_%&#39;;<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&gt; SHOW session VARIABLES LIKE &#39;wait_%&#39;;<br>
+---------------+-------+<br>
| Variable_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&#39;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 that 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 following 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(&#39;holidayshop&#39;,&#39;dba&#39;,...) failed:=
 Authentication plugin &#39;mysql_native_password&#39; cannot be loaded: no=
t initialized at /var/www/holidayshop/perl/<a href=3D"http://validatephone.=
pl" target=3D"_blank">validatephone.pl</a> line 16.<br>
</div>
<div><br>
</div>
<div>The actual line #16 in the code is:</div>
<div><br>
</div>
<div>my $logdb =3D DBI-&gt;connect(&#39;DBI:mysql:holidayshop&#39;, &#39;db=
a&#39;, &#39;theactualpw&#39;);<br>
</div>
<div><br>
</div>
<div>Hundreds of thousands of connections occur either outright or out of c=
ache without error and work just fine.=C2=A0 =C2=A0The only problem is thes=
e 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 this?</div>
<div><br>
</div>
<div><dl><dt style=3D"color:rgb(0,0,0);font-family:&quot;Times New Roman&qu=
ot;;font-size:medium">
Server Version: Apache/2.4.57 (AlmaLinux) OpenSSL/3.0.7 mod_perl/2.0.12 Per=
l/v5.32.1</dt><dt style=3D"color:rgb(0,0,0);font-family:&quot;Times New Rom=
an&quot;;font-size:medium">Server MPM: event</dt><dt style=3D"color:rgb(0,0=
,0);font-family:&quot;Times New Roman&quot;;font-size:medium">Server versio=
n: 8.0.39 MySQL Community Server - GPL<br>
</dt><dt style=3D"color:rgb(0,0,0);font-family:&quot;Times New Roman&quot;;=
font-size:medium"><br>
</dt><dt style=3D"color:rgb(0,0,0);font-family:&quot;Times New Roman&quot;;=
font-size:medium">Thanks,</dt><dt style=3D"color:rgb(0,0,0);font-family:&qu=
ot;Times New Roman&quot;;font-size:medium">Tim</dt></dl></div>
</div>
</div>
</div>
</blockquote>
</div>

</blockquote></div></div>

--000000000000d67fc70623eb5f04--