I've run into a strange situation. Recently moved servers, both were using the latest version of WHM/cPanel (and similar set up in terms of other software), and the same versions of php/MySQL. There was a processing script on the old server that required thousands of SELECT queries to be processed (just SELECT queries, no INSERTS), and it managed to do that pretty quickly, in about 19 seconds. The queries are being run in a 'for' loop.
When the same script was run on the new server, which is actually faster and has more RAM, it takes much much longer, about 3 or 4 minutes. Having analysed the queries, it seems they start out really quickly, and then instead of hundreds of queries being processed per second like at the start, it falls all the way down to about a dozen every second. On the old server, they're being processed at a steady, fast, rate.
Other than the obvious suggestion of optimizing the script (I already have, and have bypassed the problem), can anyone suggest what could be happening? Is there some kind of intentional throttling in play here?
I bypassed the problem by having a script that processes a few hundred queries at a time, and then a main script that calls that script via curl, and even though the number of SELECT's remain the same, the processing is done in about the same time as the old server (actually a bit faster, as you would expect).
One major difference between the old server and the new server is that the new server is running 64-bit RHEL 5, vs 32-bit RHEL 4 on the old server. Not sure if this could be the cause.