• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[Tip] Use APC

  • Thread starter Thread starter Floris
  • Start date Start date
Complete post for reference:
I'd like to make myself clear on this - I personally do not recommend that you use APC for shared memory caching via your config file.

We use APC here for its opcode cache only, which it does automatically by virtue of being installed on your server. I do recommend that you have APC installed, for its opcode cache, which will massively speed up your page loads vs a system without APC.

If you want to use a shared-memory cache system, I'd recommend memcache, not APC.
About this part:
I'd like to make myself clear on this - I personally do not recommend that you use APC for shared memory caching via your config file.
Does that mean have "apc.shm_segments = 0" in the php.ini file?
http://www.php.net/manual/en/apc.configuration.php#ini.apc.shm-segments

(I am just learning)
 
Dean,

As long as you do not modify XF config.php file to tell it to use APC as a memory cache then nothing will get stored inside APC apart from OpCode caching.
 
some useful info, can be used as a base for further optimization. Works quite well for me, with a few different sites (wordpress etc) and thousands of small image attachments on a xenforo forum.
apc.enabled=1
apc.shm_segments=1

;The apc.shm_size is the maximum amount of space in MB that APC is allowed to use to
;cache data. This needs to be set high enough so that all data that is being cached can be
;cached without purging data. The default of 32MB is much too small, a setting of 256MB is
;recommended
apc.shm_size=256M

; Relative to approx cached PHP files,
apc.num_files_hint=10000

; Relative to approx WP size W/ APC Object Cache Backend,
apc.user_entries_hint=10000

apc.ttl=7200
apc.use_request_time=1
apc.user_ttl=7200
apc.gc_ttl=3600
apc.cache_by_default=1
apc.filters
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.file_update_protection=2
apc.enable_cli=0
apc.max_file_size=2M

;This should be used when you are finished with PHP file changes.
;As you must clear the APC cache to recompile already cached files.
;If you are still developing, set this to 1.
apc.stat=0

apc.stat_ctime=0
apc.canonicalize=1
apc.write_lock=1
apc.report_autofilter=0
apc.rfc1867=0
apc.rfc1867_prefix =upload_
apc.rfc1867_name=APC_UPLOAD_PROGRESS
apc.rfc1867_freq=0
apc.rfc1867_ttl=3600

apc.include_once_override=0

apc.lazy_classes=0
apc.lazy_functions=0
apc.coredump_unmap=0
apc.file_md5=0
apc.preload_path

relevant;
http://blog.nexcess.net/2011/03/25/optimizing-apc-cache-settings-for-magento/
http://stackoverflow.com/questions/4575341/php-with-apc-fatal-errors-cannot-redeclare-class
 
some useful info, can be used as a base for further optimization. Works quite well for me, with a few different sites (wordpress etc) and thousands of small image attachments on a xenforo forum.


relevant;
http://blog.nexcess.net/2011/03/25/optimizing-apc-cache-settings-for-magento/
http://stackoverflow.com/questions/4575341/php-with-apc-fatal-errors-cannot-redeclare-class

This was useful.

Normally I leave apc alone as configuring the setting sometimes prove to be problematic.... However, I've made us of your full apc log.

Thank you :)
 
Top Bottom