And the performance bottleneck is... localhost?!
While troubleshooting performance for a Fakoli website (one of the few production sites we have running on IIS under Windows) I was concerned to find that connecting to the database was taking over a second. Previously this had not been a performance issue, so why were things slow now?
Trawling through StackOverflow, I found a reply to a similar problem indicating that it seems that PDO is drastically slower making database connections to a local database if the database hostname is given as "localhost" rather than using the raw IP address "127.0.0.1". I made this change and lo, the connection times went down to less than 0.01 seconds. This has a huge performance impact on a Fakoli site, since images and other assets are often served dynamically.
This performance problem seems to be related to PHP 5.4 and later - the same site performed fine back when it was on PHP 5.3. Anyhow, be warned - localhost may be stealing your performance!
