茄子在线看片免费人成视频,午夜福利精品a在线观看,国产高清自产拍在线观看,久久综合久久狠狠综合

    <s id="ddbnn"></s>
  • <sub id="ddbnn"><ol id="ddbnn"></ol></sub>

  • <legend id="ddbnn"></legend><s id="ddbnn"></s>

    PHP開啟opcache提升代碼性能
    來源:易賢網(wǎng) 閱讀:2568 次 日期:2015-04-28 15:25:54
    溫馨提示:易賢網(wǎng)小編為您整理了“PHP開啟opcache提升代碼性能”,方便廣大網(wǎng)友查閱!

    PHP開啟opcache提升代碼性能

    APC在PHP5.4及以下版本是性能最好的代碼緩存。不過PHP升級(jí)到5.5及以上后,APC不再有效。需要使用Zend的OpCache擴(kuò)展。

    配置指令如下:

    [opcache]

    zend_extension=opcache.so

    opcache.enable_cli=1

    ;共享內(nèi)存大小, 這個(gè)根據(jù)你們的需求可調(diào)

    opcache.memory_consumption=256

    ;interned string的內(nèi)存大小, 也可調(diào)

    opcache.interned_strings_buffer=8

    ;最大緩存的文件數(shù)目

    opcache.max_accelerated_files=4000

    ;60s檢查一次文件更新

    opcache.revalidate_freq=60

    ;打開快速關(guān)閉, 打開這個(gè)在PHP Request Shutdown的時(shí)候 會(huì)收內(nèi)存的速度會(huì)提高

    opcache.fast_shutdown=1

    ;不保存文件/函數(shù)的注釋

    opcache.save_comments=0

    實(shí)際性能對(duì)比:

    下面是實(shí)際測(cè)試中沒有開啟opcache的數(shù)據(jù):

    [root@localhost ~]# ab -n 10000 -c 200 ""

    This is ApacheBench, Version 2.3 <$Revision: 655654 $>

    Copyright 1996 Adam Twiss, Zeus Technology Ltd,

    Licensed to The Apache Software Foundation,

    Benchmarking 112.126.69.14 (be patient)

    Completed 1000 requests

    Completed 2000 requests

    Completed 3000 requests

    Completed 4000 requests

    Completed 5000 requests

    Completed 6000 requests

    Completed 7000 requests

    Completed 8000 requests

    Completed 9000 requests

    Completed 10000 requests

    Finished 10000 requests

    Server Software: openresty/1.7.2.1

    Server Hostname: 112.126.69.14

    Server Port: 80

    Document Path: /main.php?a=Role&m=createRole

    Document Length: 2 bytes

    Concurrency Level: 200

    Time taken for tests: 26.061 seconds

    Complete requests: 10000

    Failed requests: 20

    (Connect: 0, Receive: 0, Length: 20, Exceptions: 0)

    Write errors: 0

    Non-2xx responses: 20

    Total transferred: 1713580 bytes

    HTML transferred: 23520 bytes

    Requests per second: 383.72 [#/sec] (mean)

    Time per request: 521.216 [ms] (mean)

    Time per request: 2.606 [ms] (mean, across all concurrent requests)

    Transfer rate: 64.21 [Kbytes/sec] received

    Connection Times (ms)

    min mean[+/-sd] median max

    Connect: 2 3 3.2 2 60

    Processing: 17 461 905.0 219 16496

    Waiting: 17 461 904.9 219 16496

    Total: 21 464 905.0 222 16502

    Percentage of the requests served within a certain time (ms)

    50% 222

    66% 271

    75% 369

    80% 412

    90% 805

    95% 1248

    98% 2597

    99% 3489

    100% 16502 (longest request)

    開啟之后的數(shù)據(jù):

    [root@localhost ~]# ab -n 10000 -c 200 ""

    This is ApacheBench, Version 2.3 <$Revision: 655654 $>

    Copyright 1996 Adam Twiss, Zeus Technology Ltd,

    Licensed to The Apache Software Foundation,

    Benchmarking 112.126.69.14 (be patient)

    Completed 1000 requests

    Completed 2000 requests

    Completed 3000 requests

    Completed 4000 requests

    Completed 5000 requests

    Completed 6000 requests

    Completed 7000 requests

    Completed 8000 requests

    Completed 9000 requests

    Completed 10000 requests

    Finished 10000 requests

    Server Software: openresty/1.7.2.1

    Server Hostname: 112.126.69.14

    Server Port: 80

    Document Path: /main.php?a=Role&m=createRole

    Document Length: 2 bytes

    Concurrency Level: 200

    Time taken for tests: 14.237 seconds

    Complete requests: 10000

    Failed requests: 0

    Write errors: 0

    Total transferred: 1711710 bytes

    HTML transferred: 20020 bytes

    Requests per second: 702.40 [#/sec] (mean)

    Time per request: 284.739 [ms] (mean)

    Time per request: 1.424 [ms] (mean, across all concurrent requests)

    Transfer rate: 117.41 [Kbytes/sec] received

    Connection Times (ms)

    min mean[+/-sd] median max

    Connect: 2 66 272.6 2 3005

    Processing: 4 176 666.4 6 9026

    Waiting: 4 163 642.8 6 9026

    Total: 6 242 745.7 9 10028

    Percentage of the requests served within a certain time (ms)

    50% 9

    66% 14

    75% 99

    80% 122

    90% 1006

    95% 1476

    98% 2853

    99% 3543

    100% 10028 (longest request)

    以上所述就是本文的全部?jī)?nèi)容,希望大家能夠喜歡。

    更多信息請(qǐng)查看IT技術(shù)專欄

    更多信息請(qǐng)查看網(wǎng)絡(luò)編程
    易賢網(wǎng)手機(jī)網(wǎng)站地址:PHP開啟opcache提升代碼性能
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2026上岸·考公考編培訓(xùn)報(bào)班

    • 報(bào)班類型
    • 姓名
    • 手機(jī)號(hào)
    • 驗(yàn)證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡(jiǎn)要咨詢 | 簡(jiǎn)要咨詢須知 | 新媒體/短視頻平臺(tái) | 手機(jī)站點(diǎn) | 投訴建議
    工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號(hào):hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報(bào)警專用圖標(biāo)