zendtech / ZendOptimizerPlus

Other
915 stars 142 forks source link

opcache_enabled automatically turns false #225

Open shivamdixit opened 8 years ago

shivamdixit commented 8 years ago

I've the following OPCode configuration in php.ini:

opcache.enable=1
opcache.memory_consumption=256
opcache.interned_strings_buffer=32
opcache.max_accelerated_files=40000
opcache.validate_timestamps=1
opcache.revalidate_freq=10
opcache.fast_shutdown=1
opcache.enable_file_override=1
opcache.inherited_hack=1
opcache.dups_fix=1

On one of the servers when I call opcache_reset() function (through php-fpm), it sometimes returns me false and the key opcache_enabled (from opcache_get_status function) is false too. It automatically becomes true after some time and then the function works. Is this behaviour expected?

Before:

array(7) {
  ["opcache_enabled"]=>
  bool(true)
  ["cache_full"]=>
  bool(true)
  ["restart_pending"]=>
  bool(false)
  ["restart_in_progress"]=>
  bool(false)
  ["memory_usage"]=>
  array(4) {
    ["used_memory"]=>
    int(268435424)
    ["free_memory"]=>
    int(32)
    ["wasted_memory"]=>
    int(0)
    ["current_wasted_percentage"]=>
    float(0)
  }
....
}

-------> Calls opcache_reset(), gets true:

Now the status is:

array(7) {
  ["opcache_enabled"]=>
  bool(true)
  ["cache_full"]=>
  bool(true)
  ["restart_pending"]=>
  bool(true)
  ["restart_in_progress"]=>
  bool(false)
  ["memory_usage"]=>
  array(4) {
    ["used_memory"]=>
    int(268435424)
    ["free_memory"]=>
    int(32)
    ["wasted_memory"]=>
    int(0)
    ["current_wasted_percentage"]=>
    float(0)
  }
 ...
}

(Notice the restart_pending flag is on now, which is expected)

Now if I call the opcache_reset() at this point in time, it returns me false with opcache_enabled also as false. What am I missing out? Same thing works fine on other servers.

viniciusss commented 7 years ago

I have the same issue using apache.

kristian-b commented 5 years ago

The same issue I face of all of our Windows IIS/PHP 7.2 servers. Any solution available?