您好,登錄后才能下訂單哦!
PHP加速插件-opcache參數(shù)詳解
zend_extension=opcache.so #這樣去加擴(kuò)展
opcache.memory_consumption=128 #為opcache分配多少共享內(nèi)存128M
opcache.interned_strings_buffer=8 #interned string的內(nèi)存大小
opcache.max_accelerated_files=4000 #最大緩存的文件數(shù)目
opcache.revalidate_freq=300 #opcache自動檢測文件是否更新的周期,單位秒
opcache.fast_shutdown=1 ##如果啟用,快速關(guān)閉序列用于加速代碼
opcache.enable_cli=1 #是否在CLI(即命令行時(shí))啟用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(即命令行時(shí))啟用opcache 1啟用
; The OPcache shared memory storage size.
;opcache.memory_consumption=64 #為opcache分配多少共享內(nèi)存,單位M
; The amount of memory for interned strings in Mbytes.
;opcache.interned_strings_buffer=4 #interned string的內(nèi)存大小
; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
;opcache.max_accelerated_files=2000 #最大緩存的文件數(shù)目。實(shí)際上這個(gè)值會使用第一個(gè)大于你配置的數(shù)字的下列素?cái)?shù){ 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987 },如你將該值指定為400,則實(shí)際上該值為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,則將當(dāng)前路徑加入到文件key中,以避免可能產(chǎn)生的同文件名的文件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會自動檢測文件的時(shí)間戳(檢測周期為revalidate_freq),并根據(jù)文件的時(shí)間戳來更新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,則每次請求時(shí)opcache都要進(jìn)行檢測。當(dāng)validate_timestamps為0時(shí),本指令無效。
; 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 #如果禁用,注釋不會被加載,就是不禁用,注釋也不會被應(yīng)用程序加載
; If enabled, a fast shutdown sequence is used for the accelerated code
;opcache.fast_shutdown=0 #如果啟用,快速關(guān)閉序列用于加速代碼
; 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 #位掩碼,每一位啟用或禁用相應(yīng)的OPcache
;opcache.inherited_hack=1
;opcache.dups_fix=0 #為解決“cannot redecllare class" 時(shí),可將其置為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= #黑名單文件設(shè)置
; Allows exclusion of large files from being cached. By default all files
; are cached.
;opcache.max_file_size=0 #允許排除大文件緩存。在默認(rèn)情況下所有文件緩存。
; Check the cache checksum each N requests.
; The default value of "0" means that the checks are disabled.
;opcache.consistency_checks=0 #每N個(gè)請求檢查緩存校驗(yàn),默認(rèn)值“0”意味著檢查禁用。開啟檢查有損性能,所以僅在調(diào)試時(shí)開啟
; How long to wait (in seconds) for a scheduled restart to begin if the cache
; is not being accessed.
;opcache.force_restart_timeout=180 #緩存中沒有被訪問多長時(shí)間(以秒為單位)調(diào)度重啟。
; OPcache error_log file name. Empty string assumes "stderr".
;opcache.error_log= #留空表示標(biāo)準(zhǔn)錯誤輸出
; 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錯誤導(dǎo)向Web服務(wù)器日志。默認(rèn)情況下,只有致命錯誤(0級)或錯誤(1級)被記錄。你也可以啟用警告(要求等級2),信息消息(3級)或調(diào)試消息(四級)。
; Preferred Shared Memory back-end. Leave empty and let the system decide.
;opcache.preferred_memory_model= #首選的共享內(nèi)存的后端。留空,讓系統(tǒng)決定。
; Protect the shared memory from unexpected writing during script execution.
; Useful for internal debugging only.
;opcache.protect_memory=0 #在腳本執(zhí)行期間保護(hù)的共享內(nèi)存被意外寫入。僅供內(nèi)部調(diào)試。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。