Loop aborts on web server

E

Emil Horowitz

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
 
J

j.keßler

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Emil said:
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+0DSocexcDFCeg1nlwBU
OACgoiPTQD+hSoE1sI+5Fbh3UQERZ24=
=Xj5u
-----END PGP SIGNATURE-----
 
S

smallpond

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
 
J

Jürgen Exner

Emil Horowitz said:
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
 
E

Emil Horowitz

"j.keßler" said:
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
 
E

Emil Horowitz

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
 
S

smallpond

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?
 
W

Willem

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
 
E

Eric Pozharski

Learn what "properl attribution" is
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.
 
D

davidfilmer

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).
 
X

Xho Jingleheimerschmidt

Eric said:
"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.

Or looking at the server's error log.

Xho
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top