• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

APC Installed! Please review my configuration file

TheBigK

Well-known member
#1
I've APC installed and have following entries in my configuration file-

Code:
$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';

$config['cache']['cacheSessions'] = true;
$config['cache']['backend'] = 'Apc';
I've noticed the following-

1. I'm getting logged out frequently.

2. I tried to set the following, but I got 'Unexpected Error Ocurred' error on all the pages when I saved the configuration file with following settings -

Code:
$config['cache']['frontendOptions'] = array(
                                        'caching'                      => true,
                                        'automatic_serialization'      => true,
                                        'lifetime'                      => 10800,
                                        'cache_id_prefix' => 'foro'
);
What am I doing wrong?
 

Slavik

XenForo moderator
Staff member
#2
1) You probably have a setitng somewhere flushing out your cached files too often.

2) Are you just adding this or replacing something else?
 

CTXMedia

Formerly CyclingTribe
#3
I'm not sure if you can specify APC as your backend cache (try installing Libmemcached for that) - so try this config:

Code:
$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] = array('caching'  =>  true,
  'cache_id_prefix'  =>  'xf_'
);
Any good?
 
Last edited:

CTXMedia

Formerly CyclingTribe
#5
So it does. :D I suspect your sessions data is being flushed when APC purges its cache, so try removing the cacheSessions line and see how that goes. (y)
 

CTXMedia

Formerly CyclingTribe
#7
Note: using: $config['cache']['backend'] = 'File'; works without any issues, no logging out.
Yeah, I think this is APC cache flushing taking your sessions data with it. Remove the cacheSessions line or install an alternative backend cache such as Libmemcached. (y)
 

MattW

Well-known member
#8
What do you use for the PHP handler (suPHP/DSO/FastCGI)?

Also, install the apc.php script that comes with APC so you can see what the cache is actually doing.
 

TheBigK

Well-known member
#10
What do you use for the PHP handler (suPHP/DSO/FastCGI)?

Also, install the apc.php script that comes with APC so you can see what the cache is actually doing.
We're on lightspeed and I think we're using DSO (will have to check again). I've access to apc.php; which settings/area should I look at?
 

MattW

Well-known member
#11
That will tell you how long APC has been running for. If APC keep restarting, then it will be flushing all the session information out.
 

CTXMedia

Formerly CyclingTribe
#16
Just give this config a try and let me know what happens:

Code:
$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] = array('caching'  =>  true,
  'automatic_serialization' => true,
  'lifetime'  => 10800,
  'cache_id_prefix'  =>  'xf_'
);
$config['cache']['backend'] = 'Apc';
Sessions should be cached to file and you should begin to see the APC cache fill with compiled PHP files.

NB: As per your note earlier in the thread - you may need to simplify the frontendOptions element to just the cache_id_prefix if the other lines cause a problem.

Cheers,
Shaun :D
 

TheBigK

Well-known member
#17
It continued to throw me out of the board. I noticed that the 'Uptime' as reported in the apc.php is '0', but it continousouly shows the memory allotment changing.
 

CTXMedia

Formerly CyclingTribe
#18
Ah, okay, well unfortunately I don't have any direct experience with LiteSpeed so can't help you dig into it any further, sorry. Let us know what the resolution is though, when you do get it sorted. (y)
 

Moshe1010

Well-known member
#19
APC did many problems on my system, especially with PHP 5.4 (APC doesn't really support it. It's in its beta stage for years already). Try installing XCache instead and see if that solves your problem.
 

Tracy Perry

Well-known member
#20
APC did many problems on my system, especially with PHP 5.4 (APC doesn't really support it. It's in its beta stage for years already). Try installing XCache instead and see if that solves your problem.
I haven't had any problems with it. Granted, most of my "users" are spammers trying to hit - but I would figure if it was unstable it would still rare it's ugly head.
example.png