On 7/11/06, Adam Zey <azey@xxxxxx> wrote:
The time taken per request, though (and that's about all we can get with a concurrency as low as 5) doesn't tell us much. We also don't know exactly what the PHP code is doing, how it does it, how your database is organized/indexed/accessed, if you have any PHP accelerators installed (Normally the PHP script would be reconverted to bytecode every execution), etc. Additionally, your test isn't really MySQL versus filesystem, it's PHP+MySQL versus filesystem. Perhaps a more useful comparison would be PHP+Filesystem versus PHP+MySQL. As in, the same PHP script for both benchmarks, except one copy uses file_get_contents and echo (Closer match than readfile, since MySQL would require loading the file into memory) and the other uses MySQL. This would be a closer match that would tell us how much latency is induced by the actual database itself rather than PHP and loading stuff into memory. Regards, Adam.
I was just running a simple test based on how I work with images. I usually upload one, resize it on the fly, and save a new image which I directly link to. Therefore I don't need anything to read and send a raw image through PHP. If you think that is a valid test, then perhaps you should use your own time to achive your adequate benchmark. As for my script: <?php $link = mysql_connect('localhost', 'test', 'test') or die('unable to connect'); mysql_select_db('test') or die('unable to select'); $sql = "SELECT imagedata FROM images WHERE id = 1"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); header('Content-Type: image/jpeg'); echo $row['imagedata']; There is an auto inc primary on the id column. I have APC disabled during this test so that isn't a problem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php