Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am implementing the apc on a shared server that currently has 1000 sites (using wordpress, moodle, etc.). I'm Looking for the admin page, and I see "Cache full count" is growing rapidly. I've tried increasing the value of "apc.shm_size" reduce value "apc.ttl" increase the value "apc.shm_segments" but I can not resolve this issue. What am I doing wrong? I'm putting down some information:

apc.ini:

extension=apc.so

apc.shm_size = 256

apc.enabled = 1

apc.ttl = 300

apc.user_ttl = 300

Ubuntu: 12.04

PHP: 5.3.10

APC: 3.1.7

Server has 16GB memory

Limit share memory: 256MB

Is there any possibility of not clearing the cache when it reaches 100%?

share|improve this question
3  
You aren't giving APC enough cache, obviously. 256MB sounds quite small for your setup. –  Michael Hampton Oct 25 '12 at 17:00
    
Michael, thanks for the reply. Correct me if I'm wrong. This "apc.shm_size" should not be set according to the result of "cat /proc/sys/kernel/shmmax"? –  user142741 Oct 25 '12 at 17:05

1 Answer 1

Try setting your apc.gc_ttl to something low, like 600, and your apc.max_file_size, which is the largest size APC will cache, to something like 2M.

apc.gc_ttl = 600
apc.max_file_size = 2M

Also, as Michael pointed out, 256M for 1000 sites is really quite low.

First, try increasing the apc.shm_size limit.

apc.shm_size = 2048M

If you're hitting the kernel shared memory limit, which can be related, but isn't always, try increasing the apc.shm_segments.

apc.shm_segments = 10
apc.shm_size = 256M
apc.max_file_size = 2
share|improve this answer
    
I did as suggested and kept the same. With 2 minutes on: "Cache full count 67.730" –  user142741 Oct 25 '12 at 17:55
    
This "apc.shm_size" should not be set according to the result of "cat /proc/sys/kernel/shmmax"? –  user142741 Oct 25 '12 at 17:58
    
I increased apc.shm_size to 1024M. It's been 5 minutes and only 1 "cache full count." Hits 225505 / Misses 19845 –  user142741 Oct 25 '12 at 18:06
    
Try increasing your apc.ttl, so that it's not trying to rebuild the cache all the time. That consumes a lot of resources. You could also try increasing the apc.shm_segments slightly, to see if that helps. –  nojak Oct 25 '12 at 19:19
    
I tested as suggested. The point is that it fills the entire cache in less than 5 minutes. Increased the "apc.shm_size" to 512M which improved slightly but still exceeds the "Cache full count". extension=apc.so apc.shm_size = 512M apc.enabled = 1 apc.ttl = 600 apc.user_ttl = 600 apc.gc_ttl = 600 apc.max_file_size = 2M apc.shm_segments = 20 –  user142741 Oct 26 '12 at 14:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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