Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running 5.3.9-1~dotdeb.3, with APC 3.1.9. APC cache gets totally fragmented after a 2hours of running. Isn't the apc.user_ttl = 0 supposed to keep the files cached until APC is restarted - and prevent this much fragmentation? What am I doing wrong?

apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 320M
apc.stat = 0
apc.user_ttl = 0
apc.num_files_hint = 1024
apc.mmap_file_mask = /tmp/apc.XXXXXX
apc.enable_cli = 0

Here is a screenshot (i'm not allowed to post it directly, yet.):

share|improve this question
I've managed to bring down the fragmentation to 10% by setting pm.max_requests to a higher value (from 50 to 250). Although this does crash php processes more often (http 502, recv() upstream errors). – bureq Feb 15 '12 at 2:11

Did you raised the kernel shmmax parameter to server 320M for shared memory as well? By default it's around 8MB.

Put the following into /etc/sysctl.conf:

kernel.shmmax = 335544320

and execute

sysctl -p

as root.

share|improve this answer

Your Answer


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.