Skip to content

opcache_enabled automatically turns false #225

@shivamdixit

Description

@shivamdixit

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions