1

APC.PHP tells me:

Uptime  2 days, 15 hours and 13 minutes
File Upload Support 1
File Cache Information
Cached Files    375 ( 53.5 MBytes)
Hits    377684
Misses  376
Request Rate (hits, misses) 1.66 cache requests/second
Hit Rate    1.66 cache requests/second
Miss Rate   0.00 cache requests/second
Insert Rate 0.00 cache requests/second
Cache full count    0
User Cache Information
Cached Variables    573 ( 2.3 MBytes)
Hits    77569
Misses  889
Request Rate (hits, misses) 0.34 cache requests/second
Hit Rate    0.34 cache requests/second
Miss Rate   0.00 cache requests/second
Insert Rate 0.06 cache requests/second
Cache full count    0

"Fragmentation: 100.00% ( 8.0 MBytes out of 8.0 MBytes in 95 fragments)"

Variables:

apc.shm_segments    1
apc.shm_size    64M
apc.slam_defense    0
apc.stat    1
apc.stat_ctime  0
apc.ttl 3600
apc.user_ttl    3600
apc.max_file_size   1M
apc.gc_ttl  3600

Environment:

Amazon EC2 micro instance, running a very small wordpress site with few visitors and about 8 plugins.

Questions:

1) Does it matter if fragmentation becomes 100%? Does it impact performance in any way?

2) Why does fragmentation not go down?
I thought it is supposed to free up space automatically when you set the ttl to > 0

3) Why does the Cache full count not increment despite being at 100% fragmentation for over 24 hours?

4) I am using APC version 3.1.7 is it worth upgrading to the latest version? (it seems more complex to use latest version due to dependencies, so I prefer to avoid if possible)

z c
  • 55
  • 1
  • 5

1 Answers1

3

1) Does it matter if fragmentation becomes 100%? Does it impact performance in any way?

Only if APC tries to add new stuff into the shm. Since your getting a 99.9% hit rate (and the only misses were for loading the files initially) it's not affecting the performance.

2) Why does fragmentation not go down?

Because the ttl only comes into play when more space is needed which can't be satisified from the current gaps.

3) Why does the Cache full count not increment

It's a bit of a misnomer - it really counts the number of times apc has had to evict stuff from the cache to make room for new entries.

I am using APC version 3.1.7 is it worth upgrading to the latest version?

That too complex a question to answer here. It's good practice to keep your installation up to date with patches for security / stability / performance - but it's also important to keep the components of your installation consistent.

symcbean
  • 19,931
  • 1
  • 29
  • 49
  • Shortly after posting this, the Cache Full Count started to increment so I did some more reading and decided to change the variables to: ttl=0, user_tll=0, shm_size=96M. I am now waiting to see how it goes. It rapidly went up to "Used 45% of memory" and "Fragmentation 10%", then has been fairly stable with just a slow increase to both memory and fragmentation. I think the problem is that I do not know how it is ideally supposed to look after say a week - what kind of numbers are a good sign and what is a bad sign? – z c May 10 '13 at 10:03
  • The most important thing to worry about is the file hit ratio = 100 * ( 1 -(misses - cached files) / hits ) percent. You can also reduce fragmentation / improve memory usage by seeding the cache in a controlled manner after it has been cleared. – symcbean May 10 '13 at 10:51
  • By "file hit ratio" do you just mean the Hits vs Misses Bar Chart in the top-right of apc.php? ie. if the miss rate is <1% then all is good? – z c May 10 '13 at 11:27
  • No - I mean 100 * ( 1 -(misses - cached files) / hits ) – symcbean May 10 '13 at 12:01
  • OK, so if that % is high then it is a good thing, right? Also, it is off topic, but if that is what is important then it begs the question why this stat is not calculated and displayed on the apc.php screen. – z c May 10 '13 at 12:38
  • In my case the result is currently 100 when I calculate 100 * ( 1 -(misses - cached files) / hits ) – z c May 10 '13 at 12:54