Loop aborts on web server

Discussion in 'Perl Misc' started by Emil Horowitz, May 13, 2009.

  1. 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
     
    Emil Horowitz, May 13, 2009
    #1
    1. Advertising

  2. Emil Horowitz

    j.keßler Guest

    -----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+0DSocexcDFCeg1nlwBU
    OACgoiPTQD+hSoE1sI+5Fbh3UQERZ24=
    =Xj5u
    -----END PGP SIGNATURE-----
     
    j.keßler, May 13, 2009
    #2
    1. Advertising

  3. Emil Horowitz

    smallpond Guest

    On May 13, 9:20 am, "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


    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
     
    smallpond, May 13, 2009
    #3
  4. "Emil Horowitz" <> 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
     
    Jürgen Exner, May 13, 2009
    #4
  5. ""j.keßler"" <> schrieb im Newsbeitrag
    news:guehrn$nbu$02$-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
     
    Emil Horowitz, May 13, 2009
    #5

  6. > On May 13, 9:20 am, "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

    >
    > 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
     
    Emil Horowitz, May 13, 2009
    #6
  7. Emil Horowitz

    smallpond Guest

    On May 13, 1:26 pm, "Emil Horowitz" <> wrote:
    > > On May 13, 9:20 am, "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

    >
    > > 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?
     
    smallpond, May 13, 2009
    #7
  8. Emil Horowitz

    Willem Guest

    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
     
    Willem, May 13, 2009
    #8
  9. On 2009-05-13, Emil Horowitz <> wrote:

    Learn what "properl attribution" is

    >> On May 13, 9:20 am, "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

    >>
    >> 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
     
    Eric Pozharski, May 13, 2009
    #9
  10. Emil Horowitz

    Guest

    On May 13, 10:26 am, "Emil Horowitz" <> 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).
     
    , May 14, 2009
    #10
  11. Eric Pozharski wrote:
    > On 2009-05-13, 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 "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
     
    Xho Jingleheimerschmidt, May 14, 2009
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    8
    Views:
    2,983
    Jhair Tocancipa Triana
    Sep 10, 2005
  2. Graham
    Replies:
    0
    Views:
    133
    Graham
    Aug 22, 2003
  3. Mike Copeland

    Use of std::string Aborts

    Mike Copeland, Dec 16, 2011, in forum: C++
    Replies:
    10
    Views:
    446
    Mike Copeland
    Dec 19, 2011
  4. Sri
    Replies:
    0
    Views:
    110
  5. Isaac Won
    Replies:
    9
    Views:
    397
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page