APC Installed! Please review my configuration file

TheBigK

Well-known member
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?
 
1) You probably have a setitng somewhere flushing out your cached files too often.

2) Are you just adding this or replacing something else?
 
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:
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)
 
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)
 
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.
 
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?
 
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.
 
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
 
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.
 
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)
 
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.
 
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.webp
 
Top Bottom