Is there a utility out there for benchmarking PHP/MySQL applications (for tracking them). I am working on Windows and have both Apache Server and MySQL server on the same machine.
I am trying to insert/update records into a MySQL db from a series of PHP arrays that have been populated by parsing and distributing information from a flat text file. And it takes so long that things seem to time out!!
I have been working on this in my spare time for a while, and can get around well enough, but still consider myself a coding newbie.
Anyway, I have 11,000 files that I want to parse and upload into about 22 different tables, a couple of which will have about 1,000,000 records of about 25 fields each. Several others are about half that size, and the rest are fairly small.
The way this is structured, I parse one file into the different arrays, and then I search through the dB for duplicates before inserting/updating. If a dupe is found, I run through the fields looking for modified data. When all arrays are complete, I go to the next file.
In the early stages of updating, things crank along fine. But as the dB gets larger, it takes longer and longer and longer, until it is taken more than 3 minutes a file, and some records seem to take so long as to time out. And that's only having gone through about 1000 - 1500 of the files I need to deal with (at this point the largest dB table is 100,000 records).
I have upped the PHP.INI timeout to 3 minutes, and increased the max allowable memory for a PHP script to 16mb, but nothing works. Is it my machine? Is it my code? Is it MySQL?
Any suggestions?
Thanks.