Categorized | PHP

PHP Optimizations

Posted on 11 September 2008 by Abidoon

Anyone ever try and optimize PHP recently?

The following settings worked really well for me

1 – export CFLAGS=”-march=cpu -O3 -pipe -msse2 -m3dnow -fomit-frame-pointer -mtune=cpu”

Based on whatever processor architecture you were using you should then replace the cpu in the above line with the name of the processor as described in GCC Manual

2 – Try configuring with the following flags added: –enable-inline-optimization

3 – Once compiled use strip to reduce the PHP binary size like so -> strip php-cgi :)

4 – For a significant performance boost I would recommend the installation of an opcode cache such as x-cache. If you don’t know what an opcode cacher is or does go here

The above mentioned optimizations led to more than 50% increase in speed and a more than 50% drop in cpu usage. Please feel free to make additional suggestions on how I can squeeze more performance  out :) !

Cheers

Tags | , , ,

Leave a Reply

 

September 2008
M T W T F S S
« Mar   Oct »
1234567
891011121314
15161718192021
22232425262728
2930