Page 1 of 1

Which one of these should I use ??

Posted: Mon Jan 30, 2006 10:07 pm
by jclarkkent2003
Hi again, lol, can't stop coding...

Which one of the following, or something better, should I use? I want to run the script every 5 minutes, and I already tried that with the first one "/usr/local/bin/php /home/mydomain/public_html/~subdomains/post.php " and I believe it caused my server to go to load of 300+ and freeze. Did I do it wrong or how should i do it so it doesn't f up my server like that?

Code: Select all

/usr/local/bin/php /home/mydomain/public_html/~subdomains/post.php	// USING

GET http://www.mydomain.com/~subdomains/zzztest/123.php > /dev/null
lynx -dump http://www.mydomain.com/~subdomains/zzztest/123.php > /dev/null
curl http://www.mydomain.com/~subdomains/zzztest/123.php > /dev/null		// INTERESTING OUTPUT
php /home/mydomain/public_html/~subdomains/zzztest/123.php
php -q /home/mydomain/public_html/~subdomains/zzztest/123.php
cd /home/mydomain/public_html/~subdomains/zzztest/;/usr/local/bin/php /home/mydomain/public_html/~subdomains/zzztest/123.php
php -f /home/mydomain/public_html/~subdomains/zzztest/123.php
POST http://www.mydomain.com/~subdomains/zzztest/123.php > /dev/null		// CRAP

/usr/local/cpanel/bin/dcpumon >/dev/null 2>&1 

nice -n 19 ./script.php > /dev/null 2>&1 &

Posted: Mon Jan 30, 2006 11:54 pm
by m3mn0n
I use lynx -dump. Works great.

Posted: Mon Jan 30, 2006 11:58 pm
by jclarkkent2003
how about my issue about the load going SKY high and freezing my server?

I'm using a script called rss2blog which supposedely auto posts to your blogs and it's absolute trash for me but i heard good things about it.

How can I use a statement to make this not crash my server every hour or two?

Posted: Tue Jan 31, 2006 8:59 am
by jclarkkent2003
yesterday afternoon, last night, I tried

*/5 * * * * nice -n 19 cd /home/mydomain/public_html/~subdomains/blog/rssp_1/;php -q /home/mydomain/public_html/~subdomains/blog/rssp_1/post.php

*/5 * * * * /usr/local/bin/php /home/mydomain/public_html/~subdomains/blog/rssp_1/post.php


and also tried at 10 and 15 minute intervals. At ALL three amounts of time plus x tried each command, all of it froze my server. I had to call the DC several times last night to get my server manually rebooted because shell/ssh would lock up after the load would sky rocket. ALL of the 512 mb ram would be eaten plus 500mb+ of the 1000 mb swap file would be eaten as well (that I could see, it would stop responding at that point...

Fella's, what should I do? I really need to use this script and i'm only using it on 20 or so blogs where my friend is using it on 10x the amount without the same problems as me....

Please assist!

Posted: Tue Jan 31, 2006 11:24 am
by Chris Corbyn
What on earth are you trying to do.... 200 blogs??? Also, please check your PM's! :evil:

Posted: Tue Jan 31, 2006 12:26 pm
by jclarkkent2003
I am not trying to post to 200 blogs, that's what I said my friend is doing, I'm trying to post to my 10-20 blogs 3 times a day (random times).

Posted: Tue Jan 31, 2006 1:02 pm
by jclarkkent2003
anyways, back to the orginal question please.....

Which statement is best, or What statement should I use to run a PHP script from shell ( added in cron every 30 mins ) and I want to protect it from using up all the ram and cpu and locking up my server.


Mem: 450920k total, 435700k used, 15220k free, 7040k buffers
Swap: 917496k total, 353768k used, 563728k free, 36720k cached


Look at that swap usage, usually the server never taps the swap or only for < 20 megs, the php script has been running for 30 minutes now and using up 350 MEGS!!!

Now I can' edit this php script, but can I put something added in that will flush ram every 5 minutes or how would I do that?

Posted: Tue Jan 31, 2006 1:21 pm
by Chris Corbyn
You're posting three times a day to less than 20 blogs... and this has been running for 30 mins... 8O

You may be better asking this in the linux forum by the way.

Posted: Tue Jan 31, 2006 2:10 pm
by jclarkkent2003
yea, it's because the script does NOT post every time it's ran, it only posts 3 times a day randomly throughout 24 hours, times 20 blogs..... so basically the REASON for running it every 30 minutes is to make it as diverse time posting as possible, you know, lol.... not look automated...