PHP Open Opcache Boost code performance, PHP open Opcache Code _php Tutorial

Source: Internet
Author: User

PHP Open Opcache Boost code performance, PHP open Opcache code


The configuration directives are as follows:

[Opcache]zend_extension=opcache.soopcache.enable_cli=1; shared memory size, this is adjustable according to your needs opcache.memory_consumption=256   

Actual Performance comparison:

The following is the data that is not open opcache in the actual test:

[Root@localhost ~]# ab-n 10000-c "Http://112.126.69.14/main.php?a=Role&m=createRole" This is Apachebench,  Version 2.3 < $Revision: 655654 $>copyright 1996 Adam Twiss, Zeus technology Ltd, http://www.zeustech.net/Licensed to The Apache software Foundation, http://www.apache.org/Benchmarking 112.126.69.14 (Be patient) completed 1000 requestscompleted requestscompleted requestscompleted 4000 requestscompleted 6000 requestscompleted requestscompleted 7000 requestscompleted 8000 requestscompleted 9000 requestscompleted 10000 requestsFinished 10000 Requestsserver software:openresty/1.7.2.1server hostname:112.126.69.14server port:80document Path:/main . php?a=role&m=createroledocument Length:2 bytesconcurrency level:200time taken for tests:26.061 secondsComple  Te requests:10000failed requests:20 (connect:0, receive:0, length:20, exceptions:0) Write errors:0non-2xx Responses:20total transferred:1713580 byteshtml TRansferred:23520 bytesrequests per second:383.72 [#/sec] (mean) time per request:521.216 [MS] (mean) time per Reque st:2.606 [MS] (mean, across all concurrent requests) Transfer rate:64.21 [Kbytes/sec] receivedconnection times (ms Min MEAN[+/-SD] Median maxconnect:2 3 3.2 2 60processing:17 461 905.0 219 16496waiting:17 461 9 04.9 219 16496total:21 464 905.0 222 16502Percentage of the requests served within a certain time (ms) 50% 222 6 6% 271 75% 369 80% 412 90% 805 95% 1248 98% 2597 99% 3489 100% 16502 (longest request)

Data after opening:

[Root@localhost ~]# ab-n 10000-c "Http://112.126.69.14/main.php?a=Role&m=createRole" This is Apachebench,  Version 2.3 < $Revision: 655654 $>copyright 1996 Adam Twiss, Zeus technology Ltd, http://www.zeustech.net/Licensed to The Apache software Foundation, http://www.apache.org/Benchmarking 112.126.69.14 (Be patient) completed 1000 requestscompleted requestscompleted requestscompleted 4000 requestscompleted 6000 requestscompleted requestscompleted 7000 requestscompleted 8000 requestscompleted 9000 requestscompleted 10000 requestsFinished 10000 Requestsserver software:openresty/1.7.2.1server hostname:112.126.69.14server port:80document Path:/main . php?a=role&m=createroledocument Length:2 bytesconcurrency level:200time taken for tests:14.237 secondsComple Te requests:10000failed requests:0write errors:0total transferred:1711710 byteshtml transferred:20020 Bytesrequests per second:702.40 [#/sec] (mean) time perrequest:284.739 [MS] (mean) time per request:1.424 [MS] (mean, across all concurrent requests) Transfer Rate:11 7.41 [Kbytes/sec] receivedconnection times (ms) min MEAN[+/-SD] Median maxconnect:2 3005Processi 272.6 2 Ng:4 176 666.4 6 9026waiting:4 163 642.8 6 9026total:6 242 745.7 9 10028Percentage of the requests SE RVed within a certain time (ms) 50% 9 66% 75% 80% 122 90% 1006 95% 1476 98% 2853 99% 3543 100% 10028 (lon Gest request)

The above is the whole content of this article, I hope you can enjoy.

http://www.bkjia.com/PHPjc/989868.html www.bkjia.com true http://www.bkjia.com/PHPjc/989868.html techarticle PHP open Opcache to improve code performance, PHP open opcache Code Configuration instructions are as follows: [Opcache]zend_extension=opcache.soopcache.enable_cli=1; shared memory size, This is based on your needs ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.