Server Hang-up

Discussion in 'PHP' started by redhits, Sep 3, 2007.

  1. #1
    Can an script like:


    exec("/usr/local/bin/php /home/realrank/public_html/fork/do.php a abc> /dev/null &");
    exec("/usr/local/bin/php /home/realrank/public_html/fork/do.php a abc> /dev/null &");
    exec("/usr/local/bin/php /home/realrank/public_html/fork/do.php a abc> /dev/null &");
    exec("/usr/local/bin/php /home/realrank/public_html/fork/do.php a abc> /dev/null &");
    exec("/usr/local/bin/php /home/realrank/public_html/fork/do.php a abc> /dev/null &");



    make the server to hang-up and become unavaible?!
     
    redhits, Sep 3, 2007 IP
  2. tandac

    tandac Active Member

    Messages:
    337
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #2
    It really depends on what do.php does.

    What I do to avoid potential problems is to avoid spawning threads within scripts. Anything "special" that I need to do in the background is done via a cron job. The job runs regularly (every 1 to 5 minutes) with a check at the beginning to ensure the script is not currently running.
     
    tandac, Sep 3, 2007 IP
  3. redhits

    redhits Notable Member

    Messages:
    3,023
    Likes Received:
    277
    Best Answers:
    0
    Trophy Points:
    255
    #3
    How can you check if the script it's running or not!?
     
    redhits, Sep 4, 2007 IP