php mysql mysqli php7性能测试

来源:互联网 发布:嘉实多机油网络代理商 编辑:程序博客网 时间:2024/06/06 02:33

测试命令为:ab -c 10 -n 300 http://192.168.6.170/order/1.php

结果是:

php5.4 mysql:

[root@localhost www]# ab -c 10 -n 300 http://192.168.6.170/order/1.php This is ApacheBench, Version 2.3 <$Revision: 1430300 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/   Benchmarking 192.168.6.170 (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Finished 300 requests     Server Software:        Apache/2.4.6 Server Hostname:        192.168.6.170 Server Port:            80   Document Path:          /order/1.php Document Length:        663178 bytes   Concurrency Level:      10 Time taken for tests:   21.091 seconds Complete requests:      300 Failed requests:        50    (Connect: 0, Receive: 0, Length: 50, Exceptions: 0) Write errors:           0 Total transferred:      198918455 bytes HTML transferred:       198805355 bytes Requests per second:    14.22 [#/sec] (mean) Time per request:       703.020 [ms] (mean) Time per request:       70.302 [ms] (mean, across all concurrent requests) Transfer rate:          9210.56 [Kbytes/sec] received   Connection Times (ms)               min  mean[+/-sd] median   max Connect:        0    0   0.1      0       0 Processing:   535  685  67.4    684     953 Waiting:      211  293  35.9    291     447 Total:        535  685  67.4    684     953   Percentage of the requests served within a certain time (ms)   50%    684   66%    706   75%    726   80%    737   90%    759   95%    791   98%    859   99%    913  100%    953 (longest request) [root@localhost www]# ab -c 10 -n 300 http://192.168.6.170/order/1.php This is ApacheBench, Version 2.3 <$Revision: 1430300 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/   Benchmarking 192.168.6.170 (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Finished 300 requests     Server Software:        Apache/2.4.6 Server Hostname:        192.168.6.170 Server Port:            80   Document Path:          /order/1.php Document Length:        548516 bytes   Concurrency Level:      10 Time taken for tests:   19.419 seconds Complete requests:      300 Failed requests:        259    (Connect: 0, Receive: 0, Length: 259, Exceptions: 0) Write errors:           0 Total transferred:      164676156 bytes HTML transferred:       164563056 bytes Requests per second:    15.45 [#/sec] (mean) Time per request:       647.305 [ms] (mean) Time per request:       64.730 [ms] (mean, across all concurrent requests) Transfer rate:          8281.34 [Kbytes/sec] received   Connection Times (ms)               min  mean[+/-sd] median   max Connect:        0    0   0.1      0       1 Processing:   491  632  71.1    615     901 Waiting:      210  289  34.4    289     548 Total:        491  632  71.1    615     901   Percentage of the requests served within a certain time (ms)   50%    615   66%    659   75%    685   80%    697   90%    728   95%    752   98%    803   99%    835  100%    901 (longest request) 

php5.4 mysqli:
<[root@localhost www]# ab -c 10 -n 300 http://192.168.6.170/order/1.phpThis is ApacheBench, Version 2.3 <$Revision: 1430300 $>Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 192.168.6.170 (be patient)Completed 100 requestsCompleted 200 requestsCompleted 300 requestsFinished 300 requests  Server Software:        Apache/2.4.6Server Hostname:        192.168.6.170Server Port:            80 Document Path:          /order/1.phpDocument Length:        509356 bytes Concurrency Level:      10Time taken for tests:   18.850 secondsComplete requests:      300Failed requests:        273   (Connect: 0, Receive: 0, Length: 273, Exceptions: 0)Write errors:           0Total transferred:      153783987 bytesHTML transferred:       153670887 bytesRequests per second:    15.92 [#/sec] (mean)Time per request:       628.338 [ms] (mean)Time per request:       62.834 [ms] (mean, across all concurrent requests)Transfer rate:          7967.04 [Kbytes/sec] received Connection Times (ms)              min  mean[+/-sd] median   maxConnect:        0    0   0.1      0       0Processing:   461  614  70.0    603    1004Waiting:      207  282  36.8    278     485Total:        461  614  70.0    603    1004 Percentage of the requests served within a certain time (ms)  50%    603  66%    635  75%    650  80%    660  90%    701  95%    747  98%    790  99%    816 100%   1004 (longest request)[root@localhost www]# ab -c 10 -n 300 http://192.168.6.170/order/1.phpThis is ApacheBench, Version 2.3 <$Revision: 1430300 $>Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 192.168.6.170 (be patient)Completed 100 requestsCompleted 200 requestsCompleted 300 requestsFinished 300 requests  Server Software:        Apache/2.4.6Server Hostname:        192.168.6.170Server Port:            80 Document Path:          /order/1.phpDocument Length:        511342 bytes Concurrency Level:      10Time taken for tests:   18.715 secondsComplete requests:      300Failed requests:        282   (Connect: 0, Receive: 0, Length: 282, Exceptions: 0)Write errors:           0Total transferred:      153389584 bytesHTML transferred:       153276484 bytesRequests per second:    16.03 [#/sec] (mean)Time per request:       623.834 [ms] (mean)Time per request:       62.383 [ms] (mean, across all concurrent requests)Transfer rate:          8003.97 [Kbytes/sec] received Connection Times (ms)              min  mean[+/-sd] median   maxConnect:        0    0   0.1      0       0Processing:   477  607  71.0    596    1053Waiting:      215  281  38.4    279     623Total:        477  607  71.0    596    1053 Percentage of the requests served within a certain time (ms)  50%    596  66%    618  75%    642  80%    657  90%    697  95%    728  98%    789  99%    869 100%   1053 (longest request)

php7 mysqli:
<[root@localhost www]# ab -c 10 -n 300 http://192.168.6.170/order/1.phpThis is ApacheBench, Version 2.3 <$Revision: 1430300 $>Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 192.168.6.170 (be patient)Completed 100 requestsCompleted 200 requestsCompleted 300 requestsFinished 300 requests  Server Software:        Apache/2.4.6Server Hostname:        192.168.6.170Server Port:            80 Document Path:          /order/1.phpDocument Length:        570534 bytes Concurrency Level:      10Time taken for tests:   15.957 secondsComplete requests:      300Failed requests:        215   (Connect: 0, Receive: 0, Length: 215, Exceptions: 0)Write errors:           0Total transferred:      159496425 bytesHTML transferred:       159391425 bytesRequests per second:    18.80 [#/sec] (mean)Time per request:       531.911 [ms] (mean)Time per request:       53.191 [ms] (mean, across all concurrent requests)Transfer rate:          9760.93 [Kbytes/sec] received Connection Times (ms)              min  mean[+/-sd] median   maxConnect:        0    0   0.0      0       0Processing:   376  519  65.1    509     952Waiting:      158  210  28.0    207     420Total:        376  519  65.1    509     952 Percentage of the requests served within a certain time (ms)  50%    509  66%    534  75%    551  80%    563  90%    594  95%    621  98%    687  99%    747 100%    952 (longest request)[root@localhost www]# ab -c 10 -n 300 http://192.168.6.170/order/1.phpThis is ApacheBench, Version 2.3 <$Revision: 1430300 $>Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 192.168.6.170 (be patient)Completed 100 requestsCompleted 200 requestsCompleted 300 requestsFinished 300 requests  Server Software:        Apache/2.4.6Server Hostname:        192.168.6.170Server Port:            80 Document Path:          /order/1.phpDocument Length:        506815 bytes Concurrency Level:      10Time taken for tests:   15.555 secondsComplete requests:      300Failed requests:        299   (Connect: 0, Receive: 0, Length: 299, Exceptions: 0)Write errors:           0Total transferred:      152157322 bytesHTML transferred:       152052322 bytesRequests per second:    19.29 [#/sec] (mean)Time per request:       518.490 [ms] (mean)Time per request:       51.849 [ms] (mean, across all concurrent requests)Transfer rate:          9552.81 [Kbytes/sec] received Connection Times (ms)              min  mean[+/-sd] median   maxConnect:        0    0   0.0      0       0Processing:   362  507  55.4    496     696Waiting:      150  207  23.5    206     296Total:        362  507  55.4    496     696 Percentage of the requests served within a certain time (ms)  50%    496  66%    521  75%    538  80%    550  90%    586  95%    611  98%    647  99%    680 100%    696 (longest request)