5

I have multiple instances of APC running on my server with similar configurations (albeit with different cache sizes. However, one of the instances is performing extremely poorly, and I have no idea why (100% cache fragmentation, high miss rate).

enter image description here

The runtime settings I'm using are as follows (pretty much out of the box):

apc.cache_by_default        1
apc.canonicalize            1
apc.coredump_unmap          0
apc.enable_cli              0
apc.enabled                 1
apc.file_md5                0
apc.file_update_protection  2
apc.filters 
apc.gc_ttl                  3600
apc.include_once_override   0
apc.lazy_classes            0
apc.lazy_functions          0
apc.max_file_size           1M
apc.mmap_file_mask  
apc.num_files_hint          1000
apc.preload_path    
apc.report_autofilter       0
apc.rfc1867                 0
apc.rfc1867_freq            0
apc.rfc1867_name            APC_UPLOAD_PROGRESS
apc.rfc1867_prefix          upload_
apc.rfc1867_ttl             3600
apc.shm_segments            1
apc.shm_size                10M
apc.slam_defense            1
apc.stat                    1
apc.stat_ctime              0
apc.ttl                     0
apc.use_request_time        1
apc.user_entries_hint       4096
apc.user_ttl                0
apc.write_lock              1

APC is version 3.1.6, PHP is 5.3.3-1ubuntu9.5. I've tried restarting Apache multiple times, so this isn't a freak instance.

The instance with problems is simply running Wordpress with a few plugins installed. All other instances (~4) on the server are running perfectly fine with almost 100% hit rates and 0% fragmentation; for example this instance is holding a website built using the Symfony framework.

Any help would be much appreciated; I haven't had much experience with APC and was hoping for it to be an out-of-the-box speed boost ;).

4
  • While this is technically a sysadmin question not a developer question, I'd suggest asking this over on ServerFault as there will likely be more APC experience over there. Mar 19, 2012 at 10:28
  • 1
    @SimonJGreen: Do you mean Stack Overflow by chance?
    – Sven
    Mar 19, 2012 at 10:34
  • @SvenW I totally did ;) Have some vote :) Mar 19, 2012 at 10:35
  • Why have you only allocated 10M to APC? That seems REALLY low for any modern CMS (Wordpress, Drupal, Joomla).
    – HTTP500
    Jul 17, 2012 at 15:10

1 Answer 1

2

When using APC one of the things you need to ask yourself how much memory will be allocated to APC. apc.shm_size controls how much memory will be allocated. All my setups are configured to use 30M (I believe 32M is the default option). Also, check your "cache full count" to ensure APC is actually working. This shows how often the cache is at maximum capacity. If the cache is constantly being filled it will certainly take a heavy hit on your scripts performance. You could also try allowing PHP to use more memory as a test case

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.