[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: Please help: resource limit for running Perl under Apache?
From:       John Dunlap <john () lariat ! co>
Date:       2017-05-23 3:25:34
Message-ID: CAC5eUSuCHSRUtY+7WZa8+6Mapf22B2DoNC_odqMhmFf1OUeOwg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


You could try checking dmesg. Sometimes I see things like this in ours:

[4585112.266794] Out of memory: Kill process 18584 (perl) score 937 or
sacrifice child

[4585112.266842] Killed process 18584 (perl) total-vm:53547100kB,
anon-rss:47902052kB, file-rss:0kB

On Mon, May 22, 2017 at 9:13 PM, ST Wong (ITSC) <ST@itsc.cuhk.edu.hk> wrote:

> Hi,
>
> Thanks for your advice.
> We've done before by writing data read from ssh command to separate log
> file. The output simply ends somewhere.  Then the Perl script continues
> with the rest of the code, e.g.  the Perl script prints some headings, then
> a table containing lines from the ssh command, and print some footnotes at
> the end of script.    The output html looks 'normal' except there are fewer
> lines in the table.  It's unlikely the Perl script aborted.
>
> Will ask web admin to check Apache log for any hint.
>
> Thanks again.
>
> -----Original Message-----
> From: André Warnier (tomcat) [mailto:aw@ice-sa.com]
> Sent: Monday, May 22, 2017 7:35 PM
> To: modperl@perl.apache.org
> Subject: Re: Please help: resource limit for running Perl under Apache?
>
> Hi.
>
> It sounds like what you need to do is :
> add some logging directly in your perl script, to a separate logfile.
> (And maybe re-open STDERR to that same logfile).
> Then you will see exactly where and why the perl script crashes under
> Apache.
> Do not forget that when the perl script runs under Apache, it runs under
> the same user-id as the Apache webserver.
>
> On 22.05.2017 12:40, ST Wong (ITSC) wrote:
> > Hi, I've a Perl script that does following:
> >
> > -Ssh to a device and get information, e.g.:  open(DEV, "/usr/bin/ssh
> > -v
> > statuser\@192.168.11.1 sh get client list| ");
> >
> > -Loop through the result and display as html.
> >
> > The Perl script can complete without problem when run in bash or in
> Apache 2.2.
> >
> > However, when I put it on a new Apache 2.4 server, the script can't
> display all output -
> > the output table expected to be 1000 lines now ends at ~300.   Checked
> that it seems the
> > ssh command terminated prematurely.  The "while (<DEV>)" loop exists as
> there is no more
> > input data.   The Perl can also complete without problem when run in
> bash on the same
> > server running Apache 2.4.
> >
> > I wonder if there is any resource limit for CGI/Perl when running under
> Apache 2.4.
> >    Default OS resource limit looks alright:
> >
> > stack size              (kbytes, -s) 8192
> >
> > cpu time               (seconds, -t) unlimited
> >
> > max user processes              (-u) 15014
> >
> > virtual memory          (kbytes, -v) unlimited
> >
> > Sorry that I'm not web admin and don't have access to Apache logs.
> >
> > Would anyone please help?   Thanks a lot.
> >
> > Regards
> >
>
>


-- 
John Dunlap
*CTO | Lariat *

*Direct:*
*john@lariat.co <john@lariat.co>*

*Customer Service:*
877.268.6667
support@lariat.co

[Attachment #5 (text/html)]

<div dir="ltr">You could try checking dmesg. Sometimes I see things like this in \
ours:<div>







<p class="gmail-p1"><span class="gmail-s1">[4585112.266794] Out of memory: Kill \
process 18584 (perl) score 937 or sacrifice child</span></p> <p \
class="gmail-p1"><span class="gmail-s1">[4585112.266842] Killed process 18584 (perl) \
total-vm:53547100kB, anon-rss:47902052kB, file-rss:0kB</span></p></div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On Mon, May 22, 2017 at 9:13 PM, ST \
Wong (ITSC) <span dir="ltr">&lt;<a href="mailto:ST@itsc.cuhk.edu.hk" \
target="_blank">ST@itsc.cuhk.edu.hk</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Hi,<br> <br>
Thanks for your advice.<br>
We&#39;ve done before by writing data read from ssh command to separate log file. The \
output simply ends somewhere.   Then the Perl script continues with the rest of the \
code, e.g.   the Perl script prints some headings, then a table containing lines from \
the ssh command, and print some footnotes at the end of script.      The output html \
looks &#39;normal&#39; except there are fewer lines in the table.   It&#39;s unlikely \
the Perl script aborted.<br> <br>
Will ask web admin to check Apache log for any hint.<br>
<br>
Thanks again.<br>
<span class=""><br>
-----Original Message-----<br>
From: André Warnier (tomcat) [mailto:<a \
                href="mailto:aw@ice-sa.com">aw@ice-sa.com</a>]<br>
Sent: Monday, May 22, 2017 7:35 PM<br>
To: <a href="mailto:modperl@perl.apache.org">modperl@perl.apache.org</a><br>
Subject: Re: Please help: resource limit for running Perl under Apache?<br>
<br>
Hi.<br>
<br>
It sounds like what you need to do is :<br>
add some logging directly in your perl script, to a separate logfile.<br>
(And maybe re-open STDERR to that same logfile).<br>
Then you will see exactly where and why the perl script crashes under Apache.<br>
Do not forget that when the perl script runs under Apache, it runs under the same \
user-id as the Apache webserver.<br> <br>
On <a href="tel:22.05.2017%2012" value="+12205201712">22.05.2017 12</a>:40, ST Wong \
(ITSC) wrote:<br> &gt; Hi, I&#39;ve a Perl script that does following:<br>
&gt;<br>
&gt; -Ssh to a device and get information, e.g.:   open(DEV, &quot;/usr/bin/ssh<br>
&gt; -v<br>
&gt; statuser\@<a href="http://192.168.11.1" rel="noreferrer" \
target="_blank">192.168.11.1</a> sh get client list| &quot;);<br> &gt;<br>
&gt; -Loop through the result and display as html.<br>
&gt;<br>
&gt; The Perl script can complete without problem when run in bash or in Apache \
2.2.<br> &gt;<br>
</span>&gt; However, when I put it on a new Apache 2.4 server, the script can&#39;t \
display all output -<br> <div class="HOEnZb"><div class="h5">&gt; the output table \
expected to be 1000 lines now ends at ~300.     Checked that it seems the<br> &gt; \
ssh command terminated prematurely.   The &quot;while (&lt;DEV&gt;)&quot; loop exists \
as there is no more<br> &gt; input data.     The Perl can also complete without \
problem when run in bash on the same<br> &gt; server running Apache 2.4.<br>
&gt;<br>
&gt; I wonder if there is any resource limit for CGI/Perl when running under Apache \
2.4.<br> &gt;      Default OS resource limit looks alright:<br>
&gt;<br>
&gt; stack size                     (kbytes, -s) 8192<br>
&gt;<br>
&gt; cpu time                       (seconds, -t) unlimited<br>
&gt;<br>
&gt; max user processes                     (-u) 15014<br>
&gt;<br>
&gt; virtual memory               (kbytes, -v) unlimited<br>
&gt;<br>
&gt; Sorry that I&#39;m not web admin and don&#39;t have access to Apache logs.<br>
&gt;<br>
&gt; Would anyone please help?     Thanks a lot.<br>
&gt;<br>
&gt; Regards<br>
&gt;<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div \
class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div \
style="font-size:small;font-family:arial"><span \
style="color:rgb(68,68,68);font-family:&#39;trebuchet \
ms&#39;,sans-serif;font-size:large">John Dunlap</span><br></div><div \
style="font-size:small;font-family:arial"><i style="font-family:&#39;trebuchet \
ms&#39;,sans-serif"><span \
style="color:rgb(153,153,153);font-family:tahoma,sans-serif;font-style:normal">CTO |  \
</span><span style="font-family:tahoma,sans-serif;font-style:normal"><font \
color="#ff9900">Lariat</font></span><span \
style="color:rgb(153,153,153);font-family:tahoma,sans-serif;font-style:normal">  \
</span></i><br></div><div style="font-size:small;font-family:arial"><i \
style="font-family:&#39;trebuchet ms&#39;,sans-serif"><span \
style="color:rgb(153,153,153);font-family:tahoma,sans-serif;font-style:normal"><br></span></i></div><div \
style="font-size:small;font-family:arial"><i style="font-family:&#39;trebuchet \
ms&#39;,sans-serif"><span \
style="color:rgb(153,153,153);font-family:tahoma,sans-serif;font-style:normal"><b>Direct:</b></span></i></div><div \
style="font-size:small;font-family:arial"><i style="font-family:&#39;trebuchet \
ms&#39;,sans-serif"><span \
style="color:rgb(153,153,153);font-family:tahoma,sans-serif;font-style:normal"><a \
href="mailto:john@lariat.co" style="color:rgb(17,85,204)" \
target="_blank">john@lariat.co</a></span></i></div><div \
style="font-size:small;font-family:arial"><i style="font-family:&#39;trebuchet \
ms&#39;,sans-serif"><span \
style="color:rgb(153,153,153);font-family:tahoma,sans-serif;font-style:normal"><br><b>Customer \
Service:</b></span></i></div><div style="font-size:small;font-family:arial"><span \
style="color:rgb(153,153,153);font-family:arial,helvetica,sans-serif"><a \
value="+18772686667" style="color:rgb(17,85,204)">877.268.6667</a></span></div><div \
style="font-size:small;font-family:arial"><span \
style="color:rgb(153,153,153);font-family:arial,helvetica,sans-serif"><a \
href="mailto:support@lariat.co" style="color:rgb(17,85,204)" \
target="_blank">support@lariat.co</a></span></div><div \
style="font-size:small;font-family:arial"><img \
src="cid:ii_hwm90qu91_146b4d583171a8e6" width="100" height="60"></div></div></div> \
</div>

--f403045f4e9a7b1a310550288a60--


["100x60.png" (image/png)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic