Results 1 to 6 of 6
-
07-10-2009, 12:31 PM #1Junior Guru Wannabe
- Join Date
- Aug 2006
- Posts
- 64
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"?Thanks,
Gilad.
-
07-10-2009, 12:33 PM #2Web Hosting Master
- Join Date
- Apr 2006
- Location
- United Kingdom
- Posts
- 618
Do you have PRM installed on this server? If you do, then you'll need to exclude the process in the config files.
-
07-10-2009, 01:08 PM #3Junior Guru Wannabe
- Join Date
- Aug 2006
- Posts
- 64
Thanks John but I have no PRM installed (unless it's a debian built in thing?).
Thanks,
Gilad.
-
07-11-2009, 12:13 PM #4Junior Guru
- Join Date
- Feb 2003
- Location
- India
- Posts
- 219
Try this line at the start of your script:
Code:set_time_limit(0);
Redirect the output of your script to a log file to see if any errors crop up during the running of the script.
-
07-11-2009, 11:56 PM #5Junior Guru Wannabe
- Join Date
- Aug 2006
- Posts
- 64
Thanks!
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 :-)Thanks,
Gilad.
-
07-12-2009, 12:12 AM #6The Linux Specialist
- Join Date
- Mar 2003
- Location
- /root
- Posts
- 23,990
Moved > Technical & Security Issues.
Specially 4 U
Reseller Hosting: Boost Your Websites | Fully Managed KVM VPS: 3.20 - 5.00 Ghz, Pure Dedicated Power
JoneSolutions.Com is on the net 24/7 providing stable and reliable web hosting solutions, server management and services since 2001
Debian|Ubuntu|cPanel|DirectAdmin|Enhance|Webuzo|Acronis|Estela|BitNinja|Nginx
Similar Threads
-
OOM killed process httpd
By Webberzone in forum VPS HostingReplies: 10Last Post: 12-01-2008, 04:42 PM -
my.cnf help needed Getting Killed by mysql over-loading the box
By xeonfan in forum Hosting Security and TechnologyReplies: 7Last Post: 09-26-2008, 05:51 PM -
Advice needed on process using high CPU
By Gazza-t in forum Hosting Security and TechnologyReplies: 6Last Post: 09-05-2007, 05:44 PM -
linux, bash, restrain shell users to running one specified process
By nand in forum Hosting Software and Control PanelsReplies: 6Last Post: 09-30-2004, 09:28 AM -
For sale - 100 process fully-managed Linux shell account.
By laser in forum Shared Hosting OffersReplies: 0Last Post: 09-28-2003, 10:31 AM