Website performance boost
As I mentioned in my previous post, the site was bottlenecked by having the Apache/PHP and MySQL servers on two separate machines. This is the standard setup at Dreamhost; even if you have a PS, the mysql part is hosted on a different server. So even if you don't have to share a machine with other websites hosted on Dreamhost, you're still sharing their network latency when the Apache/PHP server is communicating with the MySQL server. On a typical non-cached page, the IVRPA site makes 200-400 queries to the database. This is what caused the very slow performance that was buggering us when I wrote that last post. The situation improved, but there's still quite a bit of latency for each query.
So I did a slightly naughty thing and, as an experiment I installed a MySQL server on our main PS. After some testing at different periods of the day, I am seeing a rewarding difference between the two setups. Page load times are dramatically lower now that there is a lot less - if any - latency between PHP and MySQL.
What's the catch? It is not supported, not managed by Dreamhost. We'll have to do our own maintenance on MySQL. And ofcourse it is going to cost us more memory on the main PS. On the other hand, it could decrease load a bit as well; page loads take less time (ie: Apache/PHP are "done" quicker), so there are fewer concurrent PHP processes at work. And eventually we can stop paying for the additional MySQL PS service.
So far, the performance increase is quite spectacular. So it may be for keeps. But I'll keep an eye out for any unforeseen issues...
- Aldo Hoeben's blog
- Login or register to post comments
- Short link
-

