XenForo + caching = AMAZING

Strange. It's showing that only 1 file is cached. What are your settings in apc.ini ?
extension=apc.so

apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 320M

apc.optimization = 2
;apc.ttl = 4000
;apc.user_ttl = 3600
apc.gc_ttl = 3600
apc.cache_by_default= true
apc.enable_cli = 0
apc.file_md5 = true
apc.write_lock = true
;apc.include_once_override = true
apc.num_files_hint = 20000
apc.user_entries_hint = 1000
apc.max_file_size = 2M

apc.mmap_file_mask=/tmp/shm.XXXXXX


apc.slam_defense=0;
 
Seems someone else has come up against this - http://xenforo.com/community/threads/help-with-nginx-and-apc.43145/#post-464361

Try going back a version and installing APC-3.1.13 (just change the number in my previous instructions, it should work and should override the current version) - ler's see if that works as expected?

Cheers,
Shaun :D
Thanks for your help, Shaun
Yeap. Going back to 3.1.13 is the answer. Not sure what happened with 3.1.14. Maybe it has something to do with PHP 5.3.
1) Do you happen to know how to upgrade to PHP 5.4 as well ;)
2) Any comment on my apc.ini settings?
 
Thanks for your help, Shaun
Yeap. Going back to 3.1.13 is the answer. Not sure what happened with 3.1.14. Maybe it has something to do with PHP 5.3.
1) Do you happen to know how to upgrade to PHP 5.4 as well ;)
2) Any comment on my apc.ini settings?

Great - good to see it's sorted - and your settings look fine to me. (y)

Sorry Andy, but I wouldn't like to advise you on a PHP 5.4 upgrade; although I've just undertaken it on my own Debian server this weekend, I wouldn't want to risk complications on someone else's server and potentially leave you unable to serve your sites. It's fine if I trash my own server, but not yours ... :LOL:

Any Ubuntu owners who could give Andy a hand - or point him to some instructions?

Cheers,
Shaun :D
 
Just a side note for those who read this thread, but may not have enough ram or are using shared hosting

File Cache
config.php --- Remember to change the PATH (full server path)

PHP:
$config['cache']['enabled'] = true;
$config['cache']['cacheSessions'] = true;
$config['cache']['backend'] = 'File';
$config['cache']['backendOptions'] ['cache_dir'] = '/path/to/cache';
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] ['cache_id_prefix'] = 'xf_';

You'll also may want or need to change the prefix if you have more than 1 forum (test forum for example).

When moving your site to either a different directory or server or domain name... You'll want to delete your cache folder and make a new one (system will automatically generate new cache). Before or without doing this, things will not work.

^^ FYI ---- This only seems to be good on smaller sites with few add-ons install. Once you reach X size either in traffic or customization, this can slow things down (most likely).
 
I am on shared hosting - Bluehost.
I think they allow apc, but I asked to be installed.
As I understand it APC is cache for the php files, memcache is helping the database load as its caching simple elemnts of it.
Will bluehost allow me to install memcache? Will it work well on shared hosting or I will put too much load on their servers?
 
@Hristo Avramov
Shared hosts normally wont let you have any opcode cache from what I know but if they do let you use APC it would reduce their CPU load not increase it.

We do :) In fact access to Memcache and APC are offered at no extra cost on all our shared packages. But yeah, I think were one of the very few hosts that offer this via shared hosting :D
 
I figured out with APC isn't working and only showing 1 file as cached. Caching does not work under suPHP. Need to use FastCGI, DSO or CGI as PHP handler.

If you have php5.5+, you can use opcache. Again, make sure to not use suPHP.
 
Last edited:
Once you have php5.5 installed add the following line into your php.ini

zend_extension=/path/to/opcache.so

Find this file's location by using this command

find / -name 'opcache.so*'

then I reccomend you to install OpCacheGUI, a nice graphical interface giving you stats and cool pie graphs.

Download it here: https://github.com/PeeHaa/OpCacheGUI

Immediately after installing this correctly, the stats began to show. No more 1 file cache! Woo!
 
Top Bottom