PHP加速插件-opcache参数详解
admin
2023-06-21 18:42:22
0次

PHP加速插件-opcache参数详解


zend_extension=opcache.so    #这样去加扩展


opcache.memory_consumption=128      #为opcache分配多少共享内存128M

opcache.interned_strings_buffer=8   #interned string的内存大小

opcache.max_accelerated_files=4000  #最大缓存的文件数目

opcache.revalidate_freq=300         #opcache自动检测文件是否更新的周期,单位秒

opcache.fast_shutdown=1             ##如果启用,快速关闭序列用于加速代码

opcache.enable_cli=1                #是否在CLI(即命令行时)启用opcache   1启用



; Determines if Zend OPCache is enabled

;opcache.enable=0     #是否启用opcache  1启用


; Determines if Zend OPCache is enabled for the CLI version of PHP

;opcache.enable_cli=0    #是否在CLI(即命令行时)启用opcache   1启用


; The OPcache shared memory storage size.

;opcache.memory_consumption=64    #为opcache分配多少共享内存,单位M


; The amount of memory for interned strings in Mbytes.

;opcache.interned_strings_buffer=4    #interned string的内存大小


; The maximum number of keys (scripts) in the OPcache hash table.

; Only numbers between 200 and 100000 are allowed.

;opcache.max_accelerated_files=2000    #最大缓存的文件数目。实际上这个值会使用第一个大于你配置的数字的下列素数{ 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987 },如你将该值指定为400,则实际上该值为463.

; The maximum percentage of "wasted" memory until a restart is scheduled.

;opcache.max_wasted_percentage=5    #


; When this directive is enabled, the OPcache appends the current working

; directory to the script key, thus eliminating possible collisions between

; files with the same name (basename). Disabling the directive improves

; performance, but may break existing applications.

;opcache.use_cwd=1    #如果置为1,则将当前路径加入到文件key中,以避免可能产生的同文件名的文件key冲突


; When disabled, you must reset the OPcache manually or restart the

; webserver for changes to the filesystem to take effect.

;opcache.validate_timestamps=1    #如果置为1,则OPCACHE会自动检测文件的时间戳(检测周期为revalidate_freq),并根据文件的时间戳来更新opcode,如果置为0,则只能手动去重启opcache或重启webserver以使更新后的php文件生效


; How often (in seconds) to check file timestamps for changes to the shared

; memory storage allocation. ("1" means validate once per second, but only

; once per request. "0" means always validate)

;opcache.revalidate_freq=2   #opcache自动检测文件是否更新的周期,单位秒。如果是0,则每次请求时opcache都要进行检测。当validate_timestamps为0时,本指令无效。


; Enables or disables file search in include_path optimization

;opcache.revalidate_path=0    #


; If disabled, all PHPDoc comments are dropped from the code to reduce the

; size of the optimized code.

;opcache.save_comments=1    #是否禁用文件中的注释


; If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments"

; may be always stored (save_comments=1), but not loaded by applications

; that don't need them anyway.

;opcache.load_comments=1    #如果禁用,注释不会被加载,就是不禁用,注释也不会被应用程序加载


; If enabled, a fast shutdown sequence is used for the accelerated code

;opcache.fast_shutdown=0     #如果启用,快速关闭序列用于加速代码


; Allow file existence override (file_exists, etc.) performance feature.

;opcache.enable_file_override=0   #允许文件存在覆盖(file_exists等)性能特性。


; A bitmask, where each bit enables or disables the appropriate OPcache

; passes

;opcache.optimization_level=0xffffffff    #位掩码,每一位启用或禁用相应的OPcache


;opcache.inherited_hack=1

;opcache.dups_fix=0       #为解决“cannot redecllare class" 时,可将其置为1


; The location of the OPcache blacklist file (wildcards allowed).

; Each OPcache blacklist file is a text file that holds the names of files

; that should not be accelerated. The file format is to add each filename

; to a new line. The filename may be a full path or just a file prefix

; (i.e., /var/www/x  blacklists all the files and directories in /var/www

; that start with 'x'). Line starting with a ; are ignored (comments).

;opcache.blacklist_filename=     #黑名单文件设置


; Allows exclusion of large files from being cached. By default all files

; are cached.

;opcache.max_file_size=0   #允许排除大文件缓存。在默认情况下所有文件缓存。


; Check the cache checksum each N requests.

; The default value of "0" means that the checks are disabled.

;opcache.consistency_checks=0    #每N个请求检查缓存校验,默认值“0”意味着检查禁用。开启检查有损性能,所以仅在调试时开启


; How long to wait (in seconds) for a scheduled restart to begin if the cache

; is not being accessed.

;opcache.force_restart_timeout=180    #缓存中没有被访问多长时间(以秒为单位)调度重启。


; OPcache error_log file name. Empty string assumes "stderr".

;opcache.error_log=    #留空表示标准错误输出


; All OPcache errors go to the Web server log.

; By default, only fatal errors (level 0) or errors (level 1) are logged.

; You can also enable warnings (level 2), info messages (level 3) or

; debug messages (level 4).

;opcache.log_verbosity_level=1   #所有OPcache错误导向Web服务器日志。默认情况下,只有致命错误(0级)或错误(1级)被记录。你也可以启用警告(要求等级2),信息消息(3级)或调试消息(四级)。


; Preferred Shared Memory back-end. Leave empty and let the system decide.

;opcache.preferred_memory_model=    #首选的共享内存的后端。留空,让系统决定。


; Protect the shared memory from unexpected writing during script execution.

; Useful for internal debugging only.

;opcache.protect_memory=0    #在脚本执行期间保护的共享内存被意外写入。仅供内部调试。


相关内容

热门资讯

空调连续工作多久需要停机休息 空调连续工作的时间取决于多个因素,包括空调的型号、功率、使用环境和维护情况等。一般来说,空调可以连续...
空调哪个符号是除湿的 空调除湿功能通常用一个水滴形状的符号表示。不同品牌和型号的空调遥控器可能会有所差异,但一般来说,除湿...
格力空调多长时间加一次氟利昂 1、一般情况下,空调对氟利昂的使用量是非常小的,所以在空调使用了四年左右的时候再考虑加也没问题。2、...
空调用多长时间需要加氟一次 一般情况下是五年。当出现以下这几种情况时,空调才需要加氟。1、空调的室内机和室外机各有两个接口,当接...
格调生活·C标思享荟:卡萨帝在... 9月12日的郑州龙湖金融岛,夜风轻拂,灯光璀璨。“C标时刻共传奇——卡萨帝思享荟暨20周年品牌盛典郑...
品牌价值破千亿、高端份额持续领... 9月12日,“C标时刻共传奇——卡萨帝思享荟暨20周年品牌盛典郑州站”在郑州龙湖金融岛举办。2026...
空调主板坏了修800还是换新的 空调主板坏了是修还是换新,需要考虑多个因素,以下是一些建议:1. 维修成本:如果维修费用较低,比如 ...
空调开多久需要休息多长时间 问题:空调开多久需要休息多长时间回答:1、在使用空调的过程中,一般空调开7~8个小时左右需要休息2~...
中央空调多长时间清洗一次 1、一般空调开机前清洗一次即可,空调开机中间时段再清洗一次,空调关机时清洗一次,这样比较合理。2、空...
中央空调氟利昂多久加一次 看空调制热和制冷程度,很多人的观点认为氟利昂必须一年放一次,其实这个观点是错误的,理解上面有点偏差,...