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

Tim Lank <[email protected]> Mon, 7 Oct 2024 18:42:11 -0400
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CAHyifnQ7i9HwGi=GJ-Xbq9JbwRPjEw4s7T6Ljs8cqccYfatP-w@mail.gmail.com>
--000000000000f8535e0623eabb3c
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

it doesn't seem to explain why it would work 99+% of the time though.  I
don't think it applies to my situation exactlly

On Mon, Oct 7, 2024 at 6:31=E2=80=AFPM Mithun Bhattacharya <[email protected]=
m> wrote:

> Maybe this helps ?
>
>
> https://php.watch/articles/fix-php-mysql-84-mysql_native_password-not-loa=
ded
>
> On Mon, Oct 7, 2024, 4:56=E2=80=AFPM Tim Lank <[email protected]> wrote=
:
>
>> 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 i=
t
>> 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
>> 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 o=
f
>> 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
>>
>

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

<div dir=3D"ltr">it doesn&#39;t seem to explain why it would work 99+% of t=
he time though.=C2=A0 I don&#39;t think it applies to my situation exactlly=
</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">=
On Mon, Oct 7, 2024 at 6:31=E2=80=AFPM Mithun Bhattacharya &lt;<a href=3D"m=
ailto:[email protected]">[email protected]</a>&gt; wrote:<br></div><blockquot=
e class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px s=
olid rgb(204,204,204);padding-left:1ex"><div dir=3D"auto">Maybe this helps =
?<div dir=3D"auto"><br></div><div dir=3D"auto"><a href=3D"https://php.watch=
/articles/fix-php-mysql-84-mysql_native_password-not-loaded" target=3D"_bla=
nk">https://php.watch/articles/fix-php-mysql-84-mysql_native_password-not-l=
oaded</a><br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" cl=
ass=3D"gmail_attr">On Mon, Oct 7, 2024, 4:56=E2=80=AFPM Tim Lank &lt;<a hre=
f=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>&=
gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div =
dir=3D"ltr"><div>Apache::DBI experts:</div><div><br></div><div>I have the f=
ollowing in my <a href=3D"http://startup.pl" rel=3D"noreferrer" target=3D"_=
blank">startup.pl</a>:</div><div><br></div><div>use CGI qw(:all);<br>use CG=
I::Carp &#39;fatalsToBrowser&#39;, &#39;carpout&#39;;<br>use List::Util &#3=
9;shuffle&#39;;<br>CGI-&gt;compile(&#39;:all&#39;);<br>Apache::DBI-&gt;conn=
ect_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<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0AutoCommit =3D&gt; 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&gt; SHOW VARIABLES LIKE &#=
39;wait_%&#39;;<br>+---------------+-------+<br>| Variable_name | Value |<b=
r>+---------------+-------+<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.0=
0 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 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(&#39;holidayshop&#39;,&#39;db=
a&#39;,...) failed: Authentication plugin &#39;mysql_native_password&#39; c=
annot be loaded: not initialized at /var/www/holidayshop/perl/<a href=3D"ht=
tp://validatephone.pl" rel=3D"noreferrer" target=3D"_blank">validatephone.p=
l</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;dba&#39;, &#39;theactualpw&#39;);<br></div><div><br>=
</div><div>Hundreds of thousands of connections occur either outright or ou=
t of cache without error and work just fine.=C2=A0 =C2=A0The only problem i=
s 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 happ=
ening when doing a load test like this?</div><div><br></div><div><dl><dt st=
yle=3D"color:rgb(0,0,0);font-family:&quot;Times New Roman&quot;;font-size:m=
edium">Server Version: Apache/2.4.57 (AlmaLinux) OpenSSL/3.0.7 mod_perl/2.0=
.12 Perl/v5.32.1</dt><dt style=3D"color:rgb(0,0,0);font-family:&quot;Times =
New Roman&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=
 version: 8.0.39 MySQL Community Server - GPL<br></dt><dt style=3D"color:rg=
b(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:&quot;T=
imes New Roman&quot;;font-size:medium">Tim</dt></dl></div></div>
</blockquote></div>
</blockquote></div>

--000000000000f8535e0623eabb3c--