Hello,
I am running into a speed issue on one of my machines relating to the use of PHP's mail function. All of the servers are configured with Apache, PHP 4.2.1 as an Apache module, qmail.
Here's what's going on. I wrote a script that sends email using the basic PHP mail command and calculates the time to run the script.
The script is as follows.
<?php
$parse_start_time = microtime();
for($i=1;$i<=10;$i++){
mail("person@person.com","test - $i","this is the message $i");
}
$parse_end_time = microtime();
$time_start = explode(' ', $parse_start_time); $time_end = explode(' ',
$parse_end_time); $parse_time = number_format(($time_end[1] + $time_end[0] -
($time_start[1] + $time_start[0])), 3);
echo strftime(STORE_PARSE_DATE_TIME_FORMAT) . ' - ' . getenv(REQUEST_URI) . ' (' .$parse_time . 's to send 10 messages)' . "\n";
exit;
?>
I have run this IDENTICAL script on 5 machines I have access to. Again, all php4.2.1 as an apache module, all running apache latest release, all running qmail. Here's my problem.
Machine 1 - executes the script in 0.4 seconds
P3 500mhz, 256mb ram, typical load average of 0.6, in a production environment
Machine 2 - executes in 0.6 seconds
p3 750mhz, 256mb ram, typical load average of 0.4, in a production environment
Machine 3 - executes in 0.5 seconds
p3 800, 512mb ram, typical load of 1.2... is a shared hosting server with 800 domains.
My Problem Machine - executes in 1.2 seconds
DUAL p3 1.13mhz, 2 GIGS ram, typical load average of 0.00 because it's not in production yet.
So, the most powerful machine in terms of hardware, running the same OS, MTA, PHP version, Apache Version is running an average of 180% to 200% slower on this script that machines that are FAR less powered.
Does anyone have any idea what could be causing this at all? None of the machines have had kernel tweaks, none have had odd qmail configs set up, they are all practically identical machines... I'm just dumbfounded.
Thanks