zendtech / ZendOptimizerPlus

Other
914 stars 142 forks source link

opcache add gc feature #150

Closed tom916 closed 10 years ago

tom916 commented 10 years ago
I found the Opcache is better than APC or Xcache
APC or Xcache both has a feature to gc the cached scripts,but Opcache 
didn't has the gc feature

our site release many times one day,so after release x times
the Opcache save a file in many versions eg

/home/www/release_11/foo.php
/home/www/release_12/foo.php
/home/www/release_13/foo.php

this can lead to the opcache has no enough memoty to cache the new release files, 
in this time the opcache Cache Misses become very high and  CPU load is high ,
our php version is 5.3.26 use opcache 7.0.2

here is my config in php.ini

opcache.memory_consumption=500
opcache.enable_cli=1
opcache.revalidate_freq=60
opcache.enable_file_override=1
opcache.force_restart_timeout=30
opcache.max_accelerated_files=16229
opcache.fast_shutdown=1
opcache.save_comments=0
opcache.interned_strings_buffer=8

status in php.ini status

Opcode Caching Up and Running
Optimization Enabled
Startup OK
Shared memory model mmap
Cache hits 177990747
Cache misses 2563443
Used memory 536868960
Free memory 0
Wasted memory 1952
Cached scripts 9483
Cached keys 14605
Max keys 16229
OOM restarts 0
Hash keys restarts 0
TerryE commented 10 years ago

Close this. It's a restatement of #118