Increasing Program Run-times

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ZekeAFroid
    Junior Member
    • Feb 2005
    • 2

    #1

    Increasing Program Run-times

    I need to increase my program run time beyond the default 300 seconds. Is there a way to do that in the control panel or do I have to submt a trouble ticket?

    Thanks.
  • AndrewT
    Administrator
    • Mar 2004
    • 3657

    #2
    In general, if something is running even near that length it will result in the domain being suspended. This IS a shared hosting environment and there's one thing you have to always think of: "What would happen if everyone on the server did this?"

    What exactly are you running?

    Comment

    • sdjl
      Senior Member
      • Mar 2004
      • 502

      #3
      As Andrew says.
      If you need to run something beyond the default 30 seconds, you either need to rethink your coding, or where you're hosting.

      What is it you want to run? Do you have any code that maybe we could help you improve upon? Have you checked for errors or bad loops?

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

      Comment

      • ZekeAFroid
        Junior Member
        • Feb 2005
        • 2

        #4
        Thanks for the response.

        Actually, I am not doing the programming, so I may not know what I'm talking about, but my programmer says that he needs to run a program once to populate a database. The site is a search engine type site.

        Comment

        • anguz
          Member
          • Mar 2004
          • 47

          #5
          If it's to populate the database, I'd suggest a simple approach: do it in batches. At the end of a script I wrote, I have:

          Code:
          // Echo a page that'll request the new batch after a sec.
          if ($start > $total)
          {
          	echo '
          <html>
          	<head>
          	</head>
          
          	<body>
          		We\'re done =)
          	</body>
          </html>';
          }
          else
          {
          	echo '
          <html>
          	<head>
          		<meta http-equiv="refresh" content="1; url=', $_SERVER['PHP_SELF'], '?start=', $n, '">
          	</head>
          
          	<body>
          		In 1 sec will start the batch from ', $n, ' to ', ($n + 5), '.
          	</body>
          </html>';
          }
          I learned this approach from SMF's conversion tools from other forum softwares to avoid timeouts and server loads, although I think that one uses a form wich gets submitted with JavaScript instead of using the meta tag, not sure.

          HIH.

          Comment

          Working...