|
Posted by Rasmus Lerdorf on 04/30/05 22:20
Sebastian wrote:
> i've been doing some reading on optimizing php for fastest performance.
>
> are there any benifts to configure php with:
> --enable-inline-optimization
That's the default now, so no, you don't need that.
> also running eAccelerator.
>
> these are my current options:
> --with-apache=../apache_1.3.33 \
That's a bit of a hassle for you, I bet. You have to recompile Apache
to upgrade PHP. You can get the same performance by using --with-apxs
to get a shared library and --without-pic to make sure you get a non-pic
library. For older PHP versions, --without-pic won't work and you need
to hack your configure scripts a bit. Just change all instances of
-prefer-pic to -prefer-non-pic. Or use this patch:
http://www.lerdorf.com/php/non-pic.txt
You can tell if it is working by looking at the compile line as it is
compiling. If you see -prefer-non-pic instead of -prefer-pic on each
line it is working.
> --with-mysql=/usr/local/mysql \
> --with-xml \
> --with-gd \
> --with-jpeg-dir=/usr/lib \
> --with-png-dir=/usr/lib \
> --with-xpm \
> --enable-magic-quotes \
> --with-pear \
> --enable-gd-native-ttf \
> --with-zlib
>
> just looking for tips.. that is all.
Beyond the compile-time switches, look at your configuration. Check
your variables_order and turn off $_ENV population. That is, remove the
'E' from variables_order and look for any $_ENV instances in your code
and change them to getenv() calls.
Also, remove '.' from your include_path and always use:
include './foo.inc';
That will save you a system call on every include. At the same time,
for the real include_path includes, make sure that most of your includes
hit the first include path. If PHP has to scan multiple dirs on every
include it will be slower than it needs to be.
But most of your gains will come from profiling your actual code using
either apd or xdebug and optimizing the parts that show up as being the
bottlenecks.
-Rasmus
Navigation:
[Reply to this message]
|