Speedtest für PHP

Apache, Lighttpd, nginx, Cherokee
Post Reply
flotte
Posts: 93
Joined: 2002-09-13 23:27
 

Speedtest für PHP

Post by flotte »

Hallo

Gibt es irgendwo einen brauchbaren Speedtest für php?
Ich würde gerne mal die Auswirkung bestimmter Performance-Tools auf verschiedenen Servern testen.
djcrackman
Posts: 207
Joined: 2005-06-02 11:58
Contact:
 

Re: Speedtest für PHP

Post by djcrackman »

Ich verwende gerne das Ding:

Code: Select all

<?php
function round_up ($value, $places=0) {
  if ($places < 0) { $places = 0; }
  $mult = pow(10, $places);
  return ceil($value * $mult) / $mult;
}


$runs = 100;
echo '<b>Runs:</b> '.$runs.'<br>
<b>Calc:</b><br>
$calc = (microtime()^1024)^1024;<br>
$calc = $calc ^ (crc32(microtime()).crc32(date('Ymd')) ^ 2);<br>
$calc = $calc ^ 1024;<br>
$calc = $calc ^ crc32(date('Ymd');<br>
<br>
<b>Start ...</b><br>';

$startzeit = microtime(true);
for($x=0;$x<=$runs;$x++) {
  $calc = (microtime()^1024)^1024;
  $calc = $calc ^ (crc32(microtime()).crc32(date('Ymd')) ^ 2);
  $calc = $calc ^ 1024;
  $calc = $calc ^ crc32(date('Ymd'));
  $result[] = $calc;
}
$endzeit = microtime(true) - $startzeit;
$endzeit = $endzeit * 1000;
$endzeit = round_up($endzeit, 3);
$endzeit = str_replace(".",",",$endzeit);

echo '<br>
<b>... End</b><br>
<b><font color="#ff0000">Time:</b> '.$endzeit.' ms</font><br>
<br>';

?>
Intressante Sache: bis PHP5.0.4 war die Performance deutlich meßbar, aber bei jeder neueren Version wird das Teil lahm - warum weiß ich net *seufz*.

Um hier mal ein paar Referenzwerte zu nennen:

PHPInfo

Hardware: Amd Athlon 64 3200+ S939, 2GB RAM, 2x 250GB IDE HDD im Software-Raid1. Derzeit 2100 vhosts gehostet.
Runs: 1000
Calc:
$calc = (microtime()^1024)^1024;
$calc = $calc ^ (crc32(microtime()).crc32(date('Ymd')) ^ 2);
$calc = $calc ^ 1024;
$calc = $calc ^ crc32(date('Ymd');

Start ...

... End
Time: 24,51 ms
Post Reply