Okay, here's some real data. The two scripts are identical except for how the image is actually loaded. One passes an actual link to the img tag and the other passes a script that pulls the image out of mysql. Each test randomly pulled 200 picture names out of the mysql table then displayed a page with all of those pictures. The average size of each picture is 58k.
Test 1 and 2 were both on the same server. I just changed the entire
folder from my scsi drive to my raid-5 drive and ran the scripts again. Currently, there are 16351 Pictures both in the database and on the filesystem (the same pics) and my mysql table is just over 1 gb.
TEST RESULTS
Microsoft Windows 2000 Server
Version 5.0.2195 Service Pack 3 Build 2195
Processor 1: Intex x86 Family 6 Model 11 Stepping 1 GuineIntel ~1396 Mhz
Processor 2: Intex x86 Family 6 Model 11 Stepping 1 GuineIntel ~1396 Mhz
Total Physical Memory 2,096,616KB
Available Physical Memory 1,592,520KB
Total Virtual Memory 6,132,488KB
Available Virtual Memory 5,269,308KB
Page File Space 4,035,872KB
Test 1
"SEAGATE ST336706LW SCSI Disk Device","PHP TIME","PAGE TIME"
"SEAGATE ST336706LW SCSI Disk Device",".00667","8.516"
"SEAGATE ST336706LW SCSI Disk Device",".00647","8.672"
"SEAGATE ST336706LW SCSI Disk Device",".00664","6.984"
"SEAGATE ST336706LW SCSI Disk Device",".00637","6.75"
"SEAGATE ST336706LW SCSI Disk Device",".00650","7.625"
"MYSQL 4.0.16-NT","PHP TIME","PAGE TIME"
"MYSQL 4.0.16-NT",".53605","7.078"
"MYSQL 4.0.16-NT",".54538","6.953"
"MYSQL 4.0.16-NT",".55737","7.328"
"MYSQL 4.0.16-NT",".54073","6.594"
"MYSQL 4.0.16-NT",".56006","7.516"
Test 2
"ADAPTEC RAID-5 SCSI Disk Device","PHP TIME","PAGE TIME"
"ADAPTEC RAID-5 SCSI Disk Device",".00644","8.984"
"ADAPTEC RAID-5 SCSI Disk Device",".00684","9.078"
"ADAPTEC RAID-5 SCSI Disk Device",".00642","9.688"
"ADAPTEC RAID-5 SCSI Disk Device",".00638","9.219"
"ADAPTEC RAID-5 SCSI Disk Device",".00642","8.015"
"MYSQL 4.0.16-NT","PHP TIME","PAGE TIME"
"MYSQL 4.0.16-NT",".55151","7.094"
"MYSQL 4.0.16-NT",".55048","6.891"
"MYSQL 4.0.16-NT",".54289","6.109"
"MYSQL 4.0.16-NT",".55297","6.812"
"MYSQL 4.0.16-NT",".53319","6.578"
My conclusion is that MySQL is definately the better choice. The php overhead is significantly greater but the actual page load time makes up for it. I'd much rather have them all in an easy to manage database than to rely on the OS's filesystem.
-Dustin
Rom 8:28