成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

MixPHP/Yii/CodeIgniter 并發(fā)壓力測(cè)試

ashe / 1982人閱讀

摘要:由于是基于的傳統(tǒng)框架,如果使用的正常部署方式來(lái)對(duì)比,顯得有些不公平,由于同時(shí)支持在中運(yùn)行,所以此次測(cè)試的是部署在之中。你也來(lái)測(cè)試一下吧,

MixPHP 是一個(gè)基于 Swoole 的高性能框架,CodeIgniter 是一個(gè)元老級(jí)的輕量級(jí)框架,Yii 是一個(gè)非常流行的框架,以下是三個(gè)框架的對(duì)比。

由于 Yii/CodeIgniter 是基于 Apache/PHP-FPM 的傳統(tǒng)框架,如果使用 MixPHP 的正常 Swoole 部署方式來(lái)對(duì)比,顯得有些不公平,由于 MixPHP 同時(shí)支持在 Apache/PHP-FPM 中運(yùn)行,所以此次測(cè)試的 MixPHP 是部署在 Apache 之中。

環(huán)境

虛擬機(jī): 4 核,1G
使用 ab 工具壓測(cè),命令:ab -n 5000 -c 100 URL

Yii

Yii 關(guān)閉了 debug,并設(shè)置為 pro 環(huán)境。

默認(rèn)控制器代碼如下,輸出一個(gè) Hello World。


CodeIgniter

默認(rèn)控制器代碼如下,輸出一個(gè) Hello World。


MixPHP

默認(rèn)控制器代碼如下,輸出一個(gè) Hello World。

public function actionIndex()
{
    return "Hello World";
}
開(kāi)始測(cè)試

測(cè)試 Yii,QPS: 56.40

C:Serverapache24vc11in>ab -n 5000 -c 100 http://www.b.com/
This is ApacheBench, Version 2.3 <$Revision: 1757674 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.b.com (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
Completed 2500 requests
Completed 3000 requests
Completed 3500 requests
Completed 4000 requests
Completed 4500 requests
Completed 5000 requests
Finished 5000 requests


Server Software:        Apache/2.2.32
Server Hostname:        www.b.com
Server Port:            80

Document Path:          /
Document Length:        9 bytes

Concurrency Level:      100
Time taken for tests:   88.659 seconds
Complete requests:      5000
Failed requests:        0
Total transferred:      1080000 bytes
HTML transferred:       45000 bytes
Requests per second:    56.40 [#/sec] (mean)
Time per request:       1773.170 [ms] (mean)
Time per request:       17.732 [ms] (mean, across all concurrent requests)
Transfer rate:          11.90 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   1.0      1      29
Processing:    14 1765 4200.5    688   48084
Waiting:       14 1610 3741.9    682   46690
Total:         14 1766 4200.5    688   48084
WARNING: The median and mean for the initial connection time are not within a normal deviation
        These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)
  50%    688
  66%   1087
  75%   1400
  80%   1657
  90%   3029
  95%   7665
  98%  14760
  99%  24300
 100%  48084 (longest request)

測(cè)試 CodeIgniter ,QPS: 144.42

C:Serverapache24vc11in>ab -n 5000 -c 100 http://www.c.com/
This is ApacheBench, Version 2.3 <$Revision: 1757674 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.c.com (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
Completed 2500 requests
Completed 3000 requests
Completed 3500 requests
Completed 4000 requests
Completed 4500 requests
Completed 5000 requests
Finished 5000 requests


Server Software:        Apache/2.2.32
Server Hostname:        www.c.com
Server Port:            80

Document Path:          /
Document Length:        8 bytes

Concurrency Level:      100
Time taken for tests:   34.621 seconds
Complete requests:      5000
Failed requests:        0
Total transferred:      1075000 bytes
HTML transferred:       40000 bytes
Requests per second:    144.42 [#/sec] (mean)
Time per request:       692.419 [ms] (mean)
Time per request:       6.924 [ms] (mean, across all concurrent requests)
Transfer rate:          30.32 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.7      1      22
Processing:     8  689 1014.3    480   13324
Waiting:        8  686 1012.2    478   13324
Total:          9  689 1014.3    480   13325
WARNING: The median and mean for the initial connection time are not within a normal deviation
        These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)
  50%    480
  66%    673
  75%    810
  80%    902
  90%   1238
  95%   1808
  98%   3336
  99%   6037
 100%  13325 (longest request)

測(cè)試 MixPHP,QPS: 440.48

C:Serverapache24vc11in>ab -n 5000 -c 100 http://www.a.com/
This is ApacheBench, Version 2.3 <$Revision: 1757674 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.a.com (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
Completed 2500 requests
Completed 3000 requests
Completed 3500 requests
Completed 4000 requests
Completed 4500 requests
Completed 5000 requests
Finished 5000 requests


Server Software:        Apache/2.2.32
Server Hostname:        www.a.com
Server Port:            80

Document Path:          /
Document Length:        12 bytes

Concurrency Level:      100
Time taken for tests:   11.351 seconds
Complete requests:      5000
Failed requests:        0
Total transferred:      1025000 bytes
HTML transferred:       60000 bytes
Requests per second:    440.48 [#/sec] (mean)
Time per request:       227.026 [ms] (mean)
Time per request:       2.270 [ms] (mean, across all concurrent requests)
Transfer rate:          88.18 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   0.9      1      25
Processing:     4  222 822.4     15   10376
Waiting:        4  221 822.4     14   10376
Total:          4  222 822.4     16   10376

Percentage of the requests served within a certain time (ms)
  50%     16
  66%     69
  75%    214
  80%    364
  90%    561
  95%    762
  98%    978
  99%   1829
 100%  10376 (longest request)
結(jié)論

虛擬機(jī)文件IO性能太差,Yii 做300并發(fā)直接不響應(yīng),只好降低到100并發(fā)數(shù),同樣架構(gòu)的測(cè)試結(jié)果 MixPHP 領(lǐng)先。

你也來(lái)測(cè)試一下吧,https://github.com/mixstart/m...

| Yii | 56.40 QPS
| CodeIgniter | 144.42 QPS
| MixPHP | 440.48 QPS

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/30700.html

相關(guān)文章

  • #yyds干貨盤(pán)點(diǎn)# 性能測(cè)試

    摘要:下面就性能測(cè)試的概念分類等知識(shí)點(diǎn)進(jìn)行總結(jié)學(xué)習(xí)。綜合數(shù)據(jù)量測(cè)試指和壓力性能測(cè)試負(fù)載性能測(cè)試疲勞性能測(cè)試相結(jié)合的綜合測(cè)試。 性能測(cè)試無(wú)論是在考試還是工作中,都是一個(gè)經(jīng)常出現(xiàn)的話題,性能測(cè)試有助于確認(rèn)被測(cè)系統(tǒng)是否能夠支持性能需求,以及預(yù)期的負(fù)載增長(zhǎng)等。性能測(cè)試不只是關(guān)注不同負(fù)載場(chǎng)景下的響應(yīng)時(shí)間等指標(biāo),它也要通過(guò)測(cè)試來(lái)發(fā)現(xiàn)在不同負(fù)載場(chǎng)景下會(huì)出現(xiàn)的,例如速度變慢、內(nèi)存泄漏等問(wèn)題的原因。下面就...

    不知名網(wǎng)友 評(píng)論0 收藏0
  • jmeter---壓力測(cè)試、并發(fā)測(cè)試、吞吐量測(cè)試

    摘要:平時(shí)進(jìn)行接口壓力測(cè)試時(shí)會(huì)用到一個(gè)的工具。下載地址解壓后進(jìn)入雙擊即可進(jìn)入可以設(shè)置中文很良心呀開(kāi)始進(jìn)入正題,哈哈壓力測(cè)試新建一個(gè)測(cè)試計(jì)劃創(chuàng)建線程組值得一提的是在設(shè)置的時(shí)間范圍內(nèi)請(qǐng)求完畢。 ...

    wangym 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

最新活動(dòng)
閱讀需要支付1元查看
<