phar打包项目简单压力测试

Posted china8036

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了phar打包项目简单压力测试相关的知识,希望对你有一定的参考价值。

工具 http_load
测试url:
http://api.test.chaoma.me/agent/ad/good_goods/query
http://api.test.chaoma.me/agent/common/area/query
http://api.test.chaoma.me/agent/index/getScreenList

 

未进行phar打包

861 fetches, 48 max parallel, 1.29985e+06 bytes, in 10 seconds
1509.69 mean bytes/connection
86.0999 fetches/sec, 129984 bytes/sec
msecs/connect: 0.121065 mean, 0.253 max, 0.059 min
msecs/first-response: 268.232 mean, 537.221 max, 20.177 min
HTTP response codes:
  code 200 -- 861

 

 

GZ 压缩 phar 引入单独入口文件 857k

550 fetches, 283 max parallel, 834656 bytes, in 10 seconds
1517.56 mean bytes/connection
54.9998 fetches/sec, 83465.4 bytes/sec
msecs/connect: 0.141062 mean, 0.412 max, 0.06 min
msecs/first-response: 1430.25 mean, 4242.23 max, 30.521 min
HTTP response codes:
  code 200 -- 550

 

GZ压缩 引入全部phar

552 fetches, 282 max parallel, 824349 bytes, in 10 seconds
1493.39 mean bytes/connection
55.1999 fetches/sec, 82434.8 bytes/sec
msecs/connect: 0.141429 mean, 0.293 max, 0.08 min
msecs/first-response: 1399.32 mean, 3991.58 max, 30.834 min
HTTP response codes:
  code 200 -- 552

 

 

整体未GZ 2.6M

536 fetches, 297 max parallel, 790063 bytes, in 10.0001 seconds
1474 mean bytes/connection
53.5997 fetches/sec, 79005.8 bytes/sec
msecs/connect: 0.140284 mean, 0.277 max, 0.058 min
msecs/first-response: 1585.57 mean, 3539.12 max, 139.093 min
HTTP response codes:
  code 200 -- 536
未GZ 单独引入

530 fetches, 305 max parallel, 800659 bytes, in 10.0001 seconds
1510.68 mean bytes/connection
52.9997 fetches/sec, 80065.4 bytes/sec
msecs/connect: 0.147008 mean, 0.821 max, 0.078 min
msecs/first-response: 1737.13 mean, 5451.6 max, 43.804 min
HTTP response codes:
  code 200 -- 530

 

  每秒处理量降低 (8.5-5.5)/8.5 = 35% 

以上是关于phar打包项目简单压力测试的主要内容,如果未能解决你的问题,请参考以下文章

使用Phar来打包发布PHP程序

打包phar文件过大的问题。

php php phar打包文件[php phar包装代码]

使用phar上线你的代码包

将整个 Slim 应用程序打包到 Phar 文件中时出错

android上app应用的压力测试用啥工具好