Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Loop aborts on web server

Reply
Thread Tools

Loop aborts on web server

 
 
Emil Horowitz
Guest
Posts: n/a
 
      05-13-2009
Hi,

I have noticed that a large For loop (10,000 to 20,000 loops) aborts after
about 500 to 600 loops and terminates script execution when running on the
web server of my ISP. On my local host, the complete loop runs without
problems. Any idea about this?

Thanks, Emil


 
Reply With Quote
 
 
 
 
j.keßler
Guest
Posts: n/a
 
      05-13-2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Emil Horowitz wrote:
> Hi,
>
> I have noticed that a large For loop (10,000 to 20,000 loops) aborts after
> about 500 to 600 loops and terminates script execution when running on the
> web server of my ISP. On my local host, the complete loop runs without
> problems. Any idea about this?
>
> Thanks, Emil
>
>

Hello,

how to you execute the script ?
from console or via webserver ?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEUEARECAAYFAkoKyrMACgkQE++2Zdc7EtdabwCXQmI9+0DSoc excDFCeg1nlwBU
OACgoiPTQD+hSoE1sI+5Fbh3UQERZ24=
=Xj5u
-----END PGP SIGNATURE-----
 
Reply With Quote
 
 
 
 
smallpond
Guest
Posts: n/a
 
      05-13-2009
On May 13, 9:20 am, "Emil Horowitz" <(E-Mail Removed)> wrote:
> Hi,
>
> I have noticed that a large For loop (10,000 to 20,000 loops) aborts after
> about 500 to 600 loops and terminates script execution when running on the
> web server of my ISP. On my local host, the complete loop runs without
> problems. Any idea about this?
>
> Thanks, Emil


Web servers put a time limit on CGIs. Does your
server allow you to fork a long-running process?

http://www.stonehenge.com/merlyn/LinuxMag/col39.html
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      05-13-2009
"Emil Horowitz" <(E-Mail Removed)> wrote:
>I have noticed that a large For loop (10,000 to 20,000 loops) aborts after
>about 500 to 600 loops and terminates script execution when running on the
>web server of my ISP. On my local host, the complete loop runs without
>problems. Any idea about this?


My first guess would be different ulimits between the local host and the
web server.
Or different versions Perl, leading to different program behavoiur.

jue
 
Reply With Quote
 
Emil Horowitz
Guest
Posts: n/a
 
      05-13-2009

""j.keßler"" <(E-Mail Removed)> schrieb im Newsbeitrag
news:guehrn$nbu$02$(E-Mail Removed)-online.com...
> Emil Horowitz wrote:
>> Hi,
>>
>> I have noticed that a large For loop (10,000 to 20,000 loops) aborts
>> after
>> about 500 to 600 loops and terminates script execution when running on
>> the
>> web server of my ISP. On my local host, the complete loop runs without
>> problems. Any idea about this?
>>
>> Thanks, Emil
>>
>>

> Hello,
>
> how to you execute the script ?
> from console or via webserver ?


The problem occurs when executing the script via webserver. Via local host
the script runs without problems.

Emil


 
Reply With Quote
 
Emil Horowitz
Guest
Posts: n/a
 
      05-13-2009

> On May 13, 9:20 am, "Emil Horowitz" <(E-Mail Removed)> wrote:
>> Hi,
>>
>> I have noticed that a large For loop (10,000 to 20,000 loops) aborts
>> after
>> about 500 to 600 loops and terminates script execution when running on
>> the
>> web server of my ISP. On my local host, the complete loop runs without
>> problems. Any idea about this?
>>
>> Thanks, Emil

>
> Web servers put a time limit on CGIs. Does your
> server allow you to fork a long-running process?


I am afraid that a time limit is not the reason for the problem. I made this
test: I put a one second's "sleep" into each loop, extending the runtime of
the script many times over. Still the script aborts after about 500 loops,
as before without the "sleep" command. Any ideas?

Emil


 
Reply With Quote
 
smallpond
Guest
Posts: n/a
 
      05-13-2009
On May 13, 1:26 pm, "Emil Horowitz" <(E-Mail Removed)> wrote:
> > On May 13, 9:20 am, "Emil Horowitz" <(E-Mail Removed)> wrote:
> >> Hi,

>
> >> I have noticed that a large For loop (10,000 to 20,000 loops) aborts
> >> after
> >> about 500 to 600 loops and terminates script execution when running on
> >> the
> >> web server of my ISP. On my local host, the complete loop runs without
> >> problems. Any idea about this?

>
> >> Thanks, Emil

>
> > Web servers put a time limit on CGIs. Does your
> > server allow you to fork a long-running process?

>
> I am afraid that a time limit is not the reason for the problem. I made this
> test: I put a one second's "sleep" into each loop, extending the runtime of
> the script many times over. Still the script aborts after about 500 loops,
> as before without the "sleep" command. Any ideas?
>
> Emil


Is it creating a large data structure on each loop?
 
Reply With Quote
 
Willem
Guest
Posts: n/a
 
      05-13-2009
Emil Horowitz wrote:
) I am afraid that a time limit is not the reason for the problem. I made this
) test: I put a one second's "sleep" into each loop, extending the runtime of
) the script many times over. Still the script aborts after about 500 loops,
) as before without the "sleep" command. Any ideas?

CPU time isn't the same as runtime.
For your test, put something that does a lot of calculation
in stead of the sleep.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
 
Reply With Quote
 
Eric Pozharski
Guest
Posts: n/a
 
      05-13-2009
On 2009-05-13, Emil Horowitz <(E-Mail Removed)> wrote:

Learn what "properl attribution" is

>> On May 13, 9:20 am, "Emil Horowitz" <(E-Mail Removed)> wrote:
>>> Hi,
>>>
>>> I have noticed that a large For loop (10,000 to 20,000 loops) aborts
>>> after
>>> about 500 to 600 loops and terminates script execution when running on
>>> the
>>> web server of my ISP. On my local host, the complete loop runs without
>>> problems. Any idea about this?
>>>
>>> Thanks, Emil

>>
>> Web servers put a time limit on CGIs. Does your
>> server allow you to fork a long-running process?

>
> I am afraid that a time limit is not the reason for the problem. I made this
> test: I put a one second's "sleep" into each loop, extending the runtime of
> the script many times over. Still the script aborts after about 500 loops,
> as before without the "sleep" command. Any ideas?


"CPU time" isn't the same as "wallclock time". You've increased the
latter. Consider asking administrator of your hosting, in case you have
such option.


--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom
 
Reply With Quote
 
davidfilmer@gmail.com
Guest
Posts: n/a
 
      05-14-2009
On May 13, 10:26*am, "Emil Horowitz" <(E-Mail Removed)> wrote:
> I am afraid that a time limit is not the reason for the problem.


Yes it is.

Type the command "ulimit -a" on your local machine.

Now create a file on your webserver called ulimit.cgi and put this in
it:

#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print `ulimit -a`;

chmod the file to 755 and run it in a browser.

Compare the values for "time" (which is the CPU time limit, and has
nothing to do with wallclock time).
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Triple nested loop python (While loop insde of for loop inside ofwhile loop) Isaac Won Python 9 03-04-2013 10:08 AM
VM aborts with signal 11 vissuyk@yahoo.com Java 8 09-10-2005 03:05 PM
3DMark display "loses focus" and aborts Goober Computer Support 0 11-26-2004 12:19 AM
Recovery CD aborts after it formats the HD corvus A+ Certification 2 10-07-2003 08:39 AM
transaction aborts on alternate identical attempts Graham ASP General 0 08-22-2003 09:41 AM



Advertisments