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

Perrin Harkins <[email protected]> Thu, 10 Oct 2024 12:28:32 -0400
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CAC0_be0O=WsXV+xuaxEfxRmFd8R-An40C-qQXe8Ur3oLNm=Ohg@mail.gmail.com>
--000000000000370946062421dd35
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

DBI is supposed to install the driver when you call connect(), although
that does mean any code loaded there isn't shared in memory.

My question would be, did you get any actual failed responses in your load
test, or just these error log messages? If all the requests succeeded, then
I would suspect something where this code is somehow being run from the
parent process. (Sorry if my terminology is off; I'm a mod_perl 1 user.)

If not, it could be that your validatephone.pl code does fine when the
connection is opened for it by connect_on_init(), but after a connection
gets closed for some reason, it can't reconnect because the environment is
different. Maybe the path for shared objects is different at that point.
I'd try to figure out what's giving it that "not initialized" text in the
error message.

Other things to consider:
- Are your DBI/DBD modules compiled with the same Perl that mod_perl was
compiled with?
- Are you setting any ENV variables that might be needed by DBI/mysql and
might not get passed through to the child process?

On Thu, Oct 10, 2024 at 11:02=E2=80=AFAM Tim Lank <[email protected]> wro=
te:

> Thanks Ed.  I'll add it and see if it helps.  My load testing phase is
> already completed, but I may get a chance to retest next year.
>
> On Thu, Oct 10, 2024 at 6:32=E2=80=AFAM Edward J. Sabol <edwardjsabol@gma=
il.com>
> wrote:
>
>> On Oct 7, 2024, at 5:55=E2=80=AFPM, Tim Lank <[email protected]> wrote=
:
>>
>> 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",
>>
>>
>> I don't know if it will help or not, but, before the above lines, your
>> startup.pl should also have the following lines:
>>
>> use DBI;
>> DBI->install_driver('mysql');
>> use Apache::DBI;
>>
>> Regards,
>> Ed
>>
>>

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

<div dir=3D"ltr">DBI is supposed to install the driver when you call connec=
t(), although that does mean any code loaded=C2=A0there isn&#39;t shared in=
 memory.<div><br></div><div>My question would be, did you get any actual fa=
iled responses in your load test, or just these error log messages? If all =
the requests succeeded, then I would suspect something where this code is s=
omehow being run from the parent process. (Sorry if my terminology is off; =
I&#39;m a mod_perl 1 user.)</div><div><br></div><div>If not, it could be th=
at your <a href=3D"http://validatephone.pl">validatephone.pl</a> code does =
fine when the connection is opened for it by connect_on_init(), but after a=
 connection gets closed for some reason, it can&#39;t reconnect because the=
 environment is different. Maybe the path for shared=C2=A0objects is differ=
ent at that point. I&#39;d try to figure out what&#39;s giving it that &quo=
t;not initialized&quot; text in the error message.</div><div><br></div><div=
>Other things to consider:</div><div>- Are your DBI/DBD modules compiled wi=
th the same Perl that mod_perl was compiled with?</div><div>- Are you setti=
ng any ENV variables that might be needed by DBI/mysql and might not get pa=
ssed through to the child process?</div></div><br><div class=3D"gmail_quote=
"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Oct 10, 2024 at 11:02=E2=80=
=AFAM Tim Lank &lt;<a href=3D"mailto:[email protected]" target=3D"_blank"=
>[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204=
);padding-left:1ex"><div dir=3D"ltr">Thanks=C2=A0Ed.=C2=A0 I&#39;ll add it =
and see if it helps.=C2=A0 My load testing phase is already completed, but =
I may get a chance to retest next year.</div><br><div class=3D"gmail_quote"=
><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Oct 10, 2024 at 6:32=E2=80=
=AFAM Edward J. Sabol &lt;<a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a>&gt; wrote:<br></div><blockquote clas=
s=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid r=
gb(204,204,204);padding-left:1ex"><div dir=3D"auto"><div dir=3D"ltr"></div>=
<div dir=3D"ltr">On Oct 7, 2024, at 5:55=E2=80=AFPM, Tim Lank &lt;<a href=
=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>&g=
t; wrote:</div><blockquote type=3D"cite" style=3D"color:rgb(0,0,0)"><div di=
r=3D"ltr"><div>I have the following in my=C2=A0<a href=3D"http://startup.pl=
/" target=3D"_blank">startup.pl</a>:</div><div><br></div><div>use CGI qw(:a=
ll);<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></div></div></blockquote><div dir=3D"ltr"><blo=
ckquote type=3D"cite">=C2=A0 (&quot;DBI:mysql:holidayshop&quot;,</blockquot=
e></div><div dir=3D"ltr"><br></div><div dir=3D"ltr">I don&#39;t know if it =
will help or not, but, before the above lines, your <a href=3D"http://start=
up.pl" target=3D"_blank">startup.pl</a> should also have the following line=
s:</div><div dir=3D"ltr"><br></div><div dir=3D"ltr">use DBI;</div><div dir=
=3D"ltr"><div dir=3D"ltr">DBI-&gt;install_driver(&#39;mysql&#39;);</div><di=
v>use Apache::DBI;</div></div><div dir=3D"ltr"><br></div><div dir=3D"ltr">R=
egards,</div><div dir=3D"ltr">Ed</div><div dir=3D"ltr"><br></div></div></bl=
ockquote></div>
</blockquote></div>

--000000000000370946062421dd35--