[Tip] Use APC

Status
Not open for further replies.

Floris

I'm just me :) Hi.
Staff member
Joined
Jan 1, 2001
Messages
60,100
Make a new file called apc-test.php with inside it the following code:
PHP:
<?=phpinfo();
and run it from the browser. Search for the APC block, if you can't find it or it reports as disabled, then I strongly recommend either installing it, or enabling it.
acpblock.png


APC: http://php.net/manual/en/book.apc.php

The Alternative PHP Cache (APC) is recommended by XenForo Limited, and after running XenForo alpha and beta for a while and then turning it on, I can tell you: they are right.
  • Pages load snappy, as if they are run from localhost.
  • The server load goes down.
The above two points are the main two reasons why I run it.

Running vBulletin on the same server showed a load between 0.25 to 0.50.
Running XenForo on the same server (after import) showed a load between 0.15 and 0.35.
Running XenForo with APC on the same server showed a load between 0.05 and 0.15.

I can imagine that bigger sites will benefit even more.

It might be obvious to some, but easily overlooked by others. So I thought it was worth reminding people to consider using APC in order to make the most of their XenForo installation.

And now for the XenForo part :) Update the library/config.php with these values:

PHP:
## Caching
#  http://xenforo.com/community/threads/speed-up-your-board-caching.5699/
#  http://xenforo.com/community/threads/tip-use-apc.6456/
$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] = array(
                                        'caching'                      => true,
                                        'automatic_serialization'      => true,
                                        'lifetime'                      => 10800,
                                        'cache_id_prefix' => 'foro'
);
$config['cache']['backend'] = 'Apc';

Note: The cache_id_prefix is handy if you run more than one instance on the same server. Plus, I still recommend to set one, so it doesn't conflict with whatever else you might be running on the server :)

Some resources:
http://framework.zend.com/manual/en/zend.cache.frontends.html
http://howto.techtutz.com/install-apc-10-steps
http://mrfloris.com/vbulletin/installing-apc-on-centos-5-server/
http://google.com (search: how to install apc on <your distro here.)
 
Status
Not open for further replies.
Top