I’ve been developing a website based on symfony. Since symfony 1.3 and 1.4 came out this week, I decided to upgrade it to 1.3 and then when I feel confortable to 1.4. The upgrade was a little bit more complicated that I anticipated, mainly because I was using some plugins that are not compatible with these new versions yet.

Then, I decided to run some benchmarks using ab (Apache Benchmark) to see how symfony 1.2 and 1.3 compared. To my surprise, I did not see an improvement on speed. I was expecting the new version would be faster, but for some reason I am not seeing any improvements. I have not gone into speed improvement measures yet, this was just out of curiosity with a symfony project pretty much straight out of the box. And my development box is not fancy or speedy, but for comparing both versions it would be OK.

When I turned on view caching, things really improved, doubling the requests/second rate. I am running PHP 5.3.1 here, so I am using all the new PHP memory handling and speed improvements, which is very good for frameworks since they tend to be heavy users.

Then, since I was already dancing, I dediced to install APC, an free opcode cache. Basically it caches PHP compiled source code so subsequent requests do not have to do the parsing of PHP files. It always improves performance without touching a single line of code. But to my surprise, I got an increase from about 14 requests/sec (remember, this server is not fast at all!) to over 70 requests/sec !!! That’s 5x times faster!

It also includes a nice web page with status and statistics of cached data.


I did not get into more tweaking, but you can see there is a big difference. That’s why all our VPS servers come with APC installed by default, so you can get all the juice from your server. And that’s why you need to use it whenever possible.