Long-time APC users. What have you done to combat fragmentation?

HittingSmoke

Active member
This is a hot-button topic around the web. I have one very low-traffic XF forum that's been up for months with APC running. Fragmentation is at ~8% which is extremely reasonable considering I'm using session caching. It's at around 145MB free with a 100% hit rate. I set the opcode hint to 11k files which I determined incorrectly from a grep command but only about 2k files are being cached.

I just migrated a higher traffic vB forum to XenForo and I'm seeing much more aggressive fragmentation which I'm fairly sure is a result of the session caching and generally higher memory usage. I haven't been able to do much long-term monitoring because I've had to reset the PHP-FPM server several times while doing optimizations but fragmentation seems to hop into the high teens relatively quickly. I do see similar (to my lower traffic install) opcode usage at roughly 2000 files cached after traffic levels out over a day or so.

Does setting a proper file hint help? What about user hint? It will be a while before I can get the appropriate data for a user hint setting. The merits of hint settings in APC seem to be vague and disputed.

I'm not really looking for APC specific info that can be found in docs. I've read them all header to footer a dozen and a half times. I'm more interested in anecdotes from people who've run XenForo over long periods of time between clearing APC cache on medium traffic forums with session caching enabled. My average page load time is below .5 seconds with ngx_pagespeed and APC enabled so it's not like I'm having performance issues, even when APC fragmentation is above 10%. I'm just hoping to have some info chambered if it does become a performance issue and I have to disable session caching.
 
I dumped APC and went with Memcached and xCache (2GB and 1GB for each). Of course, it helps that I'm on a dedicated with (now) 36GB RAM.
Same here. I initially dumped APC and switched fully to Xcache. I'm now using PHP 5.5 so using Zend OPcache and Memcached for the sessions.
 
Same here. I initially dumped APC and switched fully to Xcache. I'm now using PHP 5.5 so using Zend OPcache and Memcached for the sessions.

Thinking about moving from APC to Opcache - Obviously my server will be different than yours but can you share your OpCache configs? Want to get an idea of what I'll need to tweak
 
Thinking about moving from APC to Opcache - Obviously my server will be different than yours but can you share your OpCache configs? Want to get an idea of what I'll need to tweak
This are my current settings

Code:
zend_extension=opcache.so
;opcache.error_log=/var/log/php_opcache_error.log
opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_wasted_percentage=5
opcache.max_accelerated_files=8000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=0
opcache.save_comments=1
opcache.enable_file_override=1
opcache.validate_timestamps=1
 
Back
Top Bottom