Interesting Timeout Problem - Please Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jaymz79
    New Member
    • May 2007
    • 3

    Interesting Timeout Problem - Please Help

    My program goes thru about 15.000 lines of MySQL data and each line has about 15 variable (survey results).

    Let's say I am calculating the scores and using 25 formulas for each line...

    the PHP file starts executing and goes up to about 7000-7500 and then stops executing with no reason. It is not a 3 minute or 5 minute timeout issue. This happens in 15-20 seconds.

    Is there a MAXIMUM number of formula executions kind of timeout in PHP? Please help, thanks...
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, jaymz79. Welcome to TSDN!

    Originally posted by jaymz79
    the PHP file starts executing and goes up to about 7000-7500 and then stops executing with no reason. It is not a 3 minute or 5 minute timeout issue. This happens in 15-20 seconds.
    Are you getting an error message? Is there any output at all? Should there be any output?

    How are you gauging how far your script gets before it stops (the 7000-7500 figure)?

    Does your script get to the exact same point every time before hanging, or is it fairly random?

    I take it, then, that your script is executing per-row on your MySQL results, and you're not using a stored procedure?

    If you're using a stored procedure, is it getting flagged as a 'slow query' by MySQL?

    Speaking of which, is it possible that your script is hitting an infinite loop somewhere? Perhaps there's a single row in there that has exactly the right data to make your script crash.

    Comment

    • jaymz79
      New Member
      • May 2007
      • 3

      #3
      Hello,

      It is completely random. This is the thing that pisses me off. Sometimes it goes up to 8 thousand something, sometimes it just stops at 7 thousand something... I inserted an echo line during process showing what line it is working on to see when it quits but the thing is completely random.

      There is no infinite loop because I am not doing anything that would loop back to beginning... If it is less than 5000, it works fine.

      This problem really pissed me off. Any help would be really appreciated. Thanks...


      Originally posted by pbmods
      Heya, jaymz79. Welcome to TSDN!



      Are you getting an error message? Is there any output at all? Should there be any output?

      How are you gauging how far your script gets before it stops (the 7000-7500 figure)?

      Does your script get to the exact same point every time before hanging, or is it fairly random?

      I take it, then, that your script is executing per-row on your MySQL results, and you're not using a stored procedure?

      If you're using a stored procedure, is it getting flagged as a 'slow query' by MySQL?

      Speaking of which, is it possible that your script is hitting an infinite loop somewhere? Perhaps there's a single row in there that has exactly the right data to make your script crash.

      Comment

      • Motoma
        Recognized Expert Specialist
        • Jan 2007
        • 3236

        #4
        Take a look at this post and see if you get any error messages then. I suspect you have a malformed query which is failing.

        Comment

        • pbmods
          Recognized Expert Expert
          • Apr 2007
          • 5821

          #5
          So you're executing a single query per row on 15000 rows. Is this correct?

          Comment

          • jaymz79
            New Member
            • May 2007
            • 3

            #6
            Hello guys,

            I tried the show errors option, but it really doesn't show me any error about that weird thing. The thing I don't understand is, it is completelty random, sometimes it quits at 7523 sometimes at 8190... This is driving me crazy, I am modifying the code to refresh the page within selected periods, if I do that it works. for instance if I run the same file for rows 0-2000 and then refresh the file and run 2000-4000 etc. it works. I am just guessing that PHP, or the server I am using is not able to hold thousands of variables in its cache at the same time... This is the only thing I can think of. This sucks big time.

            I would be glad to hear about your ideas, thanks for your help...

            Comment

            • Motoma
              Recognized Expert Specialist
              • Jan 2007
              • 3236

              #7
              Originally posted by jaymz79
              Hello guys,

              I tried the show errors option, but it really doesn't show me any error about that weird thing. The thing I don't understand is, it is completelty random, sometimes it quits at 7523 sometimes at 8190... This is driving me crazy, I am modifying the code to refresh the page within selected periods, if I do that it works. for instance if I run the same file for rows 0-2000 and then refresh the file and run 2000-4000 etc. it works. I am just guessing that PHP, or the server I am using is not able to hold thousands of variables in its cache at the same time... This is the only thing I can think of. This sucks big time.

              I would be glad to hear about your ideas, thanks for your help...
              Perhaps, then, you should post some code for us to look at. Are you doing anything dumb like putting @s in front of queries so they won't return errors?

              Comment

              • ukirfan
                New Member
                • May 2007
                • 1

                #8
                hi i have a similiar problem

                Hi,

                Apache stops printing php statements after looping through the multi-dimensional array, and does not reach a point where I print "hello there !" message.
                i need to output beyound the print statements in array, to execute javascript in client browser. Please help !

                try catch messages are not showing any error !
                Note : 1. all my pages work perfectly even with huge outputs, only this multi-dimensional array output is the problem
                2. always it stops when the multi-dimensional array to be printed is of certain size = 20



                Thanks
                Irfan Ahmed

                *********
                here is the code below
                <?php

                try{
                while( $localcount < $localcountfina l ) {
                if(($completeTr eeLocal[$localcount]["node"]+0) != 50000 ){
                print $completeTreeLo cal[$localcount]["routePath"];
                }

                $localcount++;
                }
                $_SESSION['completeTreeSt ruct'] = serialize( $completeTreeLo cal);
                } catch (Exception $e) {
                echo ' Caught exception: ', $e->getMessage() , "\n";
                }

                print "hello there !";

                ?>

                Comment

                • Motoma
                  Recognized Expert Specialist
                  • Jan 2007
                  • 3236

                  #9
                  Have you tried enabling the error messages as described at the top of this forum?

                  Comment

                  Working...