Performance problem with cron job?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maskeret
    Junior Member
    • Mar 2004
    • 20

    Performance problem with cron job?

    Hello,

    I have a Perl program that works fine when I execute it interactively by web.

    If I execute it as a "cron job" without any change, I got randomly some errors,
    all of this type: "Can't execute statement: MySQL server has gone away".

    The program execute select and then delete and insert in a database table.
    The table have about 1000 records.
    I'm on Cpanel22.

    There are some difference of performance between interactive and batch ("cron")
    execution? Is that a timeout problem?

    I really don't know where I have to investigate, because the execution
    of the program directly by browser is absolutely perfect.

    Thank for any help,
    Maurizio Mascheroni
    ----------------------------
    Maurizio Mascheroni - Italy
    http://www.dreamchess.com
  • sdjl
    Senior Member
    • Mar 2004
    • 502

    #2
    Does that error occur every time you execute the perl script via cron?

    David
    -----
    Do you fear the obsolescence of the metanarrative apparatus of legitimation?

    Comment

    • maskeret
      Junior Member
      • Mar 2004
      • 20

      #3
      Originally posted by sdjl
      Does that error occur every time you execute the perl script via cron?

      David
      Yes.
      The program run once a day, some minutes after midnight.
      ----------------------------
      Maurizio Mascheroni - Italy
      http://www.dreamchess.com

      Comment

      • sdjl
        Senior Member
        • Mar 2004
        • 502

        #4
        How are you calling the cron job?
        -----
        Do you fear the obsolescence of the metanarrative apparatus of legitimation?

        Comment

        • maskeret
          Junior Member
          • Mar 2004
          • 20

          #5
          Originally posted by sdjl
          How are you calling the cron job?
          Simply with:
          perl /home/path_to_program > /home/path_for_log_file
          ----------------------------
          Maurizio Mascheroni - Italy
          http://www.dreamchess.com

          Comment

          • sdjl
            Senior Member
            • Mar 2004
            • 502

            #6
            mmm, i'm stumped to be honest!
            -----
            Do you fear the obsolescence of the metanarrative apparatus of legitimation?

            Comment

            • AndrewT
              Administrator
              • Mar 2004
              • 3653

              #7
              Try running perl /home/path_to_program via SSH and see if it is working properly.

              Comment

              • Frank Hagan
                Senior Member
                • Mar 2004
                • 724

                #8
                Originally posted by maskeret
                I have a Perl program that works fine when I execute it interactively by web.

                If I execute it as a "cron job" without any change, I got randomly some errors, all of this type: "Can't execute statement: MySQL server has gone away".

                Take a look at the CRON CURL command ... you use "CURL http://www.yourdomain.tld/script_to_call.cgi" as the command line in the CRON statement. CRON then "C"alls the "URL" to run the page. Output, if any, is sent to the email address associated with the domain, so you might want to append " &> /dev/null" to the end of the command line to suppress output.
                Last edited by Frank Hagan; 01-24-2006, 05:27 PM. Reason: Added "to suppress output" to the last sentence

                Comment

                Working...