I’m working on a site that was recently converted to PHP (used to be VB.net), and the new PHP site is running ridiculously slowly (insert PHP joke here).
So the first thing I did was I went about optimizing my code, making tweaks in every place that I could find, but it didn’t help more than maybe 50 milliseconds on the load time. Then I took off URL rewrites in web.config, and that actually did cut the load time in half, but it still wasn’t acceptable.
Then I found this:
- www.silhouetteonlinestore.com/php/test.php (runs slow)
- www.silhouetteonlinestore.com/php/test.html (runs fast)
- www.silhouetteonlinestore.com/php/test.aspx (runs fast)
All three of the above files run the same static HTML code with the word “test” in the tags, but the PHP one runs slow! The test version of the site with the same configuration, on the same server, runs lightning-quick, so whatever the problem is seems to be exacerbated by extra traffic on the site. But we don’t have millions hitting the site or anything–we average 300-500 users browsing the site at any given moment.
- PHP 5.2.17 on IIS 6.0, using FastCGI
- Hosted on Windows 2008 server, with Quad-Core AMD Opteron(tm) Processor 2374 HE 2.20 GHz
- 8 GB RAM
- 64-bit OS
I’m not very experienced with server administration, so any help is appreciated. My first hunch is to upgrade to PHP 5.4.4, because there may be compatibility issues there, so I’m going to work on that; I tried to do that a while back and I couldn’t get it to work properly (phpinfo() revealed that some settings still thought it was 5.2, and I think there was an environment variable that wasn’t set or something).
Let me know what other critical information I left out; I really appreciate your time!