Welcome to Centmin Mod Community
Become a Member

PHP-FPM PHP Zend opcache cache centminmod - delay when i update php file, config file - how to turn off?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by adamus007p, Nov 30, 2019 at 9:17 AM.

  1. adamus007p

    adamus007p Premium Member Premium Member

    112
    6
    18
    Feb 8, 2019
    Ratings:
    +9
    Local Time:
    8:47 PM
    Hello, I have noticed that there is some delay.
    I don't know 1 minute then I update some config file, php file.

    How can I turn it off? I think that is something with centminmode cache.

    Can you help?
     
  2. eva2000

    eva2000 Administrator Staff Member

    42,262
    9,550
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,708
    Local Time:
    5:47 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    controlled via opcache.revalidate_freq setting

    Example defaults for Zend Opcache for 1GB VPS
    Code:
    php --ri 'Zend Opcache'
    
    Zend OPcache
    
    Opcode Caching => Disabled
    Optimization => Disabled
    Startup Failed => Opcode Caching is disabled for CLI
    
    Directive => Local Value => Master Value
    opcache.enable => On => On
    opcache.use_cwd => On => On
    opcache.validate_timestamps => On => On
    opcache.inherited_hack => On => On
    opcache.dups_fix => Off => Off
    opcache.revalidate_path => Off => Off
    opcache.log_verbosity_level => 1 => 1
    opcache.memory_consumption => 256 => 256
    opcache.interned_strings_buffer => 8 => 8
    opcache.max_accelerated_files => 16000 => 16000
    opcache.max_wasted_percentage => 5 => 5
    opcache.consistency_checks => 0 => 0
    opcache.force_restart_timeout => 180 => 180
    opcache.revalidate_freq => 180 => 180
    opcache.file_update_protection => 2 => 2
    opcache.preferred_memory_model => no value => no value
    opcache.blacklist_filename => no value => no value
    opcache.max_file_size => 0 => 0
    opcache.protect_memory => 0 => 0
    opcache.save_comments => 1 => 1
    opcache.load_comments => 1 => 1
    opcache.fast_shutdown => 1 => 1
    opcache.optimization_level => 0xFFFFFFFF => 0xFFFFFFFF
    opcache.enable_file_override => On => On
    opcache.enable_cli => Off => Off
    opcache.error_log => no value => no value
    opcache.restrict_api => no value => no value
    set in /etc/centminmod/php.d/zendopcache.ini
    Code:
    php --ini
    Configuration File (php.ini) Path: /usr/local/lib
    Loaded Configuration File:         /usr/local/lib/php.ini
    Scan for additional .ini files in: /etc/centminmod/php.d
    Additional .ini files parsed:      /etc/centminmod/php.d/a_customphp.ini,
    /etc/centminmod/php.d/curlcainfo.ini,
    /etc/centminmod/php.d/geoip.ini,
    /etc/centminmod/php.d/igbinary.ini,
    /etc/centminmod/php.d/imagick.ini,
    /etc/centminmod/php.d/memcache.ini,
    /etc/centminmod/php.d/memcached.ini,
    /etc/centminmod/php.d/mongodb.ini,
    /etc/centminmod/php.d/redis.ini,
    /etc/centminmod/php.d/zendopcache.ini
    contents of /etc/centminmod/php.d/zendopcache.ini
    Code:
    zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20100525/opcache.so
    ;opcache.error_log=/var/log/php_opcache_error.log
    opcache.enable=1
    opcache.memory_consumption=256
    opcache.interned_strings_buffer=8
    opcache.max_wasted_percentage=5
    opcache.max_accelerated_files=16000
    ; http://php.net/manual/en/opcache.configuration.php#ini.opcache.revalidate-freq
    ; defaults to zend opcache checking every 180 seconds for PHP file changes
    ; set to zero to check every second if you are doing alot of frequent
    ; php file edits/developer work
    ; opcache.revalidate_freq=0
    opcache.revalidate_freq=180
    opcache.fast_shutdown=1
    opcache.enable_cli=0
    opcache.save_comments=1
    opcache.enable_file_override=1
    opcache.validate_timestamps=1
    ;opcache.huge_code_pages=1
    
    To customise own php ini settings use own custom *.ini file PHP-FPM - CentminMod.com LEMP Nginx web stack for CentOS and reference Zend Opcache ini options PHP: Runtime Configuration - Manual

    Relevant settings for when new PHP file changes are detected by PHP
    Note lowering opcache.revalidate_freq from 180 seconds default or disabling with 0 will reduce PHP performance. You can keep 180s default and just restart php-fpm service after php file changes to flush cache instead which is what you should do after changing php files and need cache to update before 180 second timeout
     
  3. adamus007p

    adamus007p Premium Member Premium Member

    112
    6
    18
    Feb 8, 2019
    Ratings:
    +9
    Local Time:
    8:47 PM
    Thank you for your answer it is clear. I was looking for that.
     
    Last edited: Nov 30, 2019 at 11:38 AM