1

We've just installed APC on our server, and after looking at the stats for APC it appears that APC's cache takes around 5 - 10 minutes to fill up, and is then completely emptied.

Current settings include:

  • apc.shm_segments 1
  • apc.shm_size 256M
  • apc.ttl 1800
  • apc.user_ttl 1800

The server has 16GB of RAM, running ~40 vhosts. My main queries are:

  • What, roughly, should the shm_size value be set to? Is 1 - 2GB safe? Or does it depend entirely on the applications being run on the server?
  • I read that the ttl will delete 'expired' cache files, so is it a good idea to set the ttl to be just below the time it takes for the cache to fill?
  • Is there any advantage to be had by setting more than one shared memory segment?
kinglozzer
  • 111
  • 1

1 Answers1

0

We've got this sorted and stable now, with ~95% cache hit percentage. We were seeing "Unable to allocate memory to pool" errors because the cache was filling up and not emptying itself.

We've set the cache size to 1GB and the ttl to 120 (2 minutes) - this means that our cache never really exceeds around 30-40% of its capacity.

kinglozzer
  • 111
  • 1