Results 1 to 6 of 6
  1. #1

    * Advice needed - PHP process in shell keeps getting killed

    Hi guys,
    I'm not a novice but this thing is really making me feel like one

    My dedicated machine (Quad core, 8gb ram running Debian stable latest + Apache2) is giving me a real hard time.

    I got a long running php script (a crawler) that takes long to run and keep getting killed.

    The code already have max_execution_time set to -1 (also tried 90000) and max_input_time + max_memory set to -1 (meaning no limit).

    I run it in shell with nice set to 19 (!) to ensure the OS don't kill it:
    >> nice --adjust=19 /usr/bin/php -f crawl.php

    And always, at the same time (after 10 mins or so) it get "Killed".

    I can't trim down the code as the crawl is dynamic (from link to link).

    Any idea/tips/advice on how I can save the php from getting "killed"?

  2. #2
    Join Date
    Apr 2006
    United Kingdom
    Do you have PRM installed on this server? If you do, then you'll need to exclude the process in the config files.
    John Slane | Systems Administrator

  3. #3
    Thanks John but I have no PRM installed (unless it's a debian built in thing?).

  4. #4
    Join Date
    Feb 2003
    Try this line at the start of your script:
    Other than this, are you logging out of your terminal after executing this command? In case you are, use the nohup and & to get this command running in background mode.
    Redirect the output of your script to a log file to see if any errors crop up during the running of the script.

  5. #5
    I found out that the crawler was killed by the kernel as the cpu was peaking after a while (quad core) so what I did is I broke it down to a tiny crawler and I'm calling it via a shell loop over and over. Silly but seems to do the trick :-)

  6. #6
    Join Date
    Mar 2003
    Moved > Technical & Security Issues.
    Specially 4 You
    JoneSolutions.Com ( Jones.Solutions ) is on the net 24/7 providing stable and reliable web hosting solutions and services since 2001

Similar Threads

  1. OOM killed process httpd
    By Webberzone in forum VPS Hosting
    Replies: 10
    Last Post: 12-01-2008, 04:42 PM
  2. my.cnf help needed Getting Killed by mysql over-loading the box
    By xeonfan in forum Hosting Security and Technology
    Replies: 7
    Last Post: 09-26-2008, 05:51 PM
  3. Advice needed on process using high CPU
    By Gazza-t in forum Hosting Security and Technology
    Replies: 6
    Last Post: 09-05-2007, 05:44 PM
  4. linux, bash, restrain shell users to running one specified process
    By nand in forum Hosting Software and Control Panels
    Replies: 6
    Last Post: 09-30-2004, 09:28 AM
  5. For sale - 100 process fully-managed Linux shell account.
    By laser in forum Shared Hosting Offers
    Replies: 0
    Last Post: 09-28-2003, 10:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts