Currently Viewing Posts Tagged xcache

Install XCache 3.1.0 from souce on PHP 5.4.28

I have a staging server. I have installed php5.3, 5.4, and 5.5 on it. Today I tried to install XCache 3.1.0 on it with PHP 5.4.28.

First, I recompiled the PHP 5.4.28 with more features. So noted below:

1) Install additional required dev packages

yum install gmp gmp-devel

2) Compile and install php 5.4.28

cd php-5.5.12
./configure --prefix=/usr/local/php54 \
    --with-config-file-path=/etc/php54 \
    --with-config-file-scan-dir=/etc/php54/php.d \
    --with-libdir=lib64 \
    --with-mysql \
    --with-mysqli \
    --enable-mbstring \
    --disable-debug \
    --disable-rpath \
    --with-bz2 \
    --with-curl \
    --with-gettext \
    --with-iconv \
    --with-openssl \
    --with-gd \
    --with-mcrypt \
    --with-pcre-regex \
    --with-zlib \
    --enable-cgi \
    --enable-exif \
    --enable-zip \
    --with-gmp \
    --enable-ftp \
    --enable-shmop \
    --enable-sockets
make
make install

Restart Apache

service httpd restart

Then, I start to install XCache from source, the latest version of XCache is 3.1.0.

3) Download and decompress it.

wget http://xcache.lighttpd.net/pub/Releases/3.1.0/xcache-3.1.0.tar.gz
tar -xvzf xcache-3.1.0.tar.gz

4) Compile XCache based on current PHP 5.4.28 installation

cd xcache-3.1.0
/usr/local/php54/bin/phpize
./configure --enable-xcache --with-php-config=/usr/local/php54/bin/php-config
make
make install
cp xcache.ini /etc/php54/php.d/xcache.ini
service httpd restart

Then reload the phpinfo page and get following information.

web2-php54-fastcgi-withxcache

And XCache web interface:

xcache-3.1.0-php5.4.28

PHP Accelerator tools

There are a few options I can choose when I setup my PHP environment for my Web Site here.

  • APC – Alternative PHP Cache

It is used widely. Free, Open Source framework that caches the output of the PHP bytecode compiler in shared memory. Reduced parsing and disk I/O overhead for later requests.

The latest version is 3.1.13 beta released in Sep. 2012.  Support up to PHP 5.4. It is a kind of abandoned project. So if you want to use PHP 5.5, better forget it, even it was the best before.

APC website

  • XCache

XCache is a fast, stable PHP opcode cacher that has been tested and is now running on production servers under high load. It is tested on Linux and FreeBSD and supported under Windows, for thread-safe and non-thread-safe versions of PHP. This relatively new opcode caching software has been developed by mOo, one of the developers of Lighttpd, to overcome some of the limitations of the existing solutions at that time; such as being able to use it with new PHP versions as they arrive.

It is an active project. Now the latest XCache 3.1.0 support PHP 5.5.  It is easy to install XCache from source or from repos.

XCache website

 

  • eAccelerator

Accelerator is a free open-source PHP accelerator & optimizer. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 time

eAccelerator is also an older project, which moved to Github on July 25, 2012. The current master branch 0.9.6.1 supports PHP 5.3. it is released in 2010. I don’t think anyone should choose this tool.

  • Zend Opcache (ex. Zend Optimizer+)

Zend Opcache is an open source component of Zend Server and Zend Server Community Edition.It speeds up PHP execution by opcode caching and optimization. it stores precompiled script bytecode in shared memory. This eliminates the stages of reading code from the disk and compiling it on future access.

Starting with PHP 5.5 the Zend Opcache is integrated and shipped with PHP. Even with PHP 5.4, Zend Opcache can be added easily. The latest ZendOpcache 7.0.3 here.

  • IonCube Accelerator

Only supports PHP 4. No new versions on the download page since Jan. 2003.

 

Continue reading “PHP Accelerator tools”

Do you still need Xcache when you have PHP Opcache

This VPS is running with PHP 5.4.25.  Zend OPcache is a built-in module in PHP 5.4.25.

I have Xcache installed before. Today, I removed it and just use OPcache.

When I use Xcache and Opcache at the same time. And config Database cache and object cache to use opcode:Xcache. I found the Xcache doesn’t help me a lot. See screenshot below.

xcache

PHP scripts are not cached in Xcache entirely.  I thought Zend OPcache is working on php scripts.

Continue reading “Do you still need Xcache when you have PHP Opcache”

Performance improved by XCache 2.0.0

XCache is a open-source opcode cacher, which means that it accelerates the performance of PHP on servers. It optimizes performance by removing the compilation time of PHP scripts by caching the compiled state of PHP scripts into the shm (RAM) and uses the compiled version straight from the RAM. This will increase the rate of page generation time by up to 5 times as it also optimizes many other aspects of php scripts and reduce serverload.
The XCache has improved my sites performance. Look at the admin page of XCache below.
XCache-admin-page

The XCache Init Time is 2012-10-28 02:41:05. Until now, 2012-10-30 14:59:00, there are 373,367 hits on cache.

Continue reading “Performance improved by XCache 2.0.0”

Zend Optimizer and Xcache make phpBB 3 faster

I moved one phpBB forum to a VPS. All fresh.
I have Apache installed and MySQL. phpBB 3 relay on them.
Because of the size of forum, about 500K posts, 1000 users, the forum is not as fast as I think.
I have to do something to improve the performance of it. I still remember that some opcode optimizer can help.

Continue reading “Zend Optimizer and Xcache make phpBB 3 faster”

  • Archives