I have got a Magento running on Nginx, PHP-FPM, Varnish & APC setup.
APC is running high on both fragmentation and purge rate.
Fragmentation increases in 2 hours >50% and slowly goes to 100%.
Even more disturbin is the fact and Munin shows that the purge rate is almost in 100% all the time.
I tried to increase the shm size to 1G (APC normally uses about 200M of this, total RAM is 6G) which didn't help, as well tried to tweak the ttl:s without any luck.
Is there something in varnish that is causing the constant purging of APC?
Here is my APC.ini
extension = apc.so
apc.enabled=1
apc.shm_segments=1
apc.shm_size=1024M
apc.num_files_hint=10000
apc.user_entries_hint=10000
apc.max_file_size=5M
apc.stat=0
apc.enable_cli = 1
apc.optimization=0
apc.cache_by_default=1
apc.slam_defense=0
apc.include_once_override=0
apc.ttl=3600
apc.user_ttl=7200
apc.gc_ttl = 600
apc.php:
**File Cache Information**
Cached Files 1053 ( 58.1 MBytes)
Hits 40172
Misses 1038
Request Rate (hits, misses) 102.26 cache requests/second
Hit Rate 99.68 cache requests/second
Miss Rate 2.58 cache requests/second
Insert Rate 10.41 cache requests/second
Cache full count 0
**User Cache Information**
Cached Variables 74 ( 1.2 MBytes)
Hits 374
Misses 5907
Request Rate (hits, misses) 15.59 cache requests/second
Hit Rate 0.93 cache requests/second
Miss Rate 14.66 cache requests/second
Insert Rate 0.18 cache requests/second
Cache full count 0



apc.ttland lower yourapc.user_ttl. If you havepm.max_requestsset inphp-fpm, it can affect this as well. This is because cache for that process is dropped when the process hits its max request limit and the process is terminated. This, in turn, creates fragmentation. - tacotuesday