Very High Server Load & Abrupt halt of PHP script
Posted: Wed Mar 16, 2005 2:31 pm
Hi, i run Apache/PHP/Mysql on a Linux box & i have a php script eg hello.php which is triggered after a table is populated with lets say 2000 records.
The basic logic behind d triggered script is that it checks the table, retrieve the 1st record, process it, delete the record & then check the table if there are still more records in the table, if there are no records left in the table it exits but if there are more records, it does an HTTP POST to itself hello.php.
Problem 1 :
Thru'put is very low. does about 1 record per second> How can 1 read records from the same table simultaneously without reading same record more than once judging by the speed of php scripts
Probem 2 :
Found out that after like 2-3mins , it stops running & i had 2 setup a cron to run every 5mins so that they records can b processed. Could anybody tell me why.
Problem 3 :
Server Load increased tremendously. how can one manage server load effectively. Should an exit command be issued at the end of the script since i declare require_once to the connection script. eg
<?php
//Connection statement
require_once('Connections/your_connection.php');
?>
The basic logic behind d triggered script is that it checks the table, retrieve the 1st record, process it, delete the record & then check the table if there are still more records in the table, if there are no records left in the table it exits but if there are more records, it does an HTTP POST to itself hello.php.
Problem 1 :
Thru'put is very low. does about 1 record per second> How can 1 read records from the same table simultaneously without reading same record more than once judging by the speed of php scripts
Probem 2 :
Found out that after like 2-3mins , it stops running & i had 2 setup a cron to run every 5mins so that they records can b processed. Could anybody tell me why.
Problem 3 :
Server Load increased tremendously. how can one manage server load effectively. Should an exit command be issued at the end of the script since i declare require_once to the connection script. eg
<?php
//Connection statement
require_once('Connections/your_connection.php');
?>