这两年“世上最好的语言”PHP诟病于连接处理性能上,在热门语言排行榜上已显得有些后劲不足。
特别是在公司内部也掀起了一股php转go的潮流,那么作为PHP的拥护者,我内心是拒绝的。

所以当看到swoole作者在官方文档上写着“swoole的性能远远超过go自带的http和nodejs自带的http”
,我内心是无比澎湃激动的,于是我对几种语言做了个性能测试对比,想想做完测试把报告一甩,能甩go几条街。但是结果却另我有点失望,

Swoole 并没有想象中那么好, 也就比php好一点点。并没有作者说的那么牛逼,@韩天峰
https://wiki.swoole.com/wiki/page/326.html

PHP + FPM

Server Software:        nginx/1.6.2
Server Hostname:        bug.3322.org
Server Port:            80

Document Path:          /
Document Length:        11 bytes

Concurrency Level:      1
Time taken for tests:   15.185 seconds
Complete requests:      5000
Failed requests:        0
Total transferred:      780000 bytes
HTML transferred:       55000 bytes
Requests per second:    329.26 [#/sec] (mean)
Time per request:       3.037 [ms] (mean)
Time per request:       3.037 [ms] (mean, across all concurrent requests)
Transfer rate:          50.16 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   0.2      1       3
Processing:     1    2   1.3      2      65
Waiting:        1    2   1.3      2      65
Total:          2    3   1.3      3      66

Percentage of the requests served within a certain time (ms)
  50%      3
  66%      3
  75%      3
  80%      3
  90%      4
  95%      4
  98%      4
  99%      5
 100%     66 (longest request)

Nodejs
Server Software:       
Server Hostname:        192.168.1.4
Server Port:            8888

Document Path:          /
Document Length:        12 bytes

Concurrency Level:      1
Time taken for tests:   3.964 seconds
Complete requests:      5000
Failed requests:        0
Total transferred:      565000 bytes
HTML transferred:       60000 bytes
Requests per second:    1261.22 [#/sec] (mean)
Time per request:       0.793 [ms] (mean)
Time per request:       0.793 [ms] (mean, across all concurrent requests)
Transfer rate:          139.18 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       4
Processing:     0    0   0.2      0       4
Waiting:        0    0   0.2      0       4
Total:          0    1   0.3      1       7

Percentage of the requests served within a certain time (ms)
  50%      1
  66%      1
  75%      1
  80%      1
  90%      1
  95%      1
  98%      1
  99%      2
 100%      7 (longest request)

GO
Server Software:       
Server Hostname:        192.168.1.4
Server Port:            9000

Document Path:          /
Document Length:        11 bytes

Concurrency Level:      1
Time taken for tests:   3.913 seconds
Complete requests:      5000
Failed requests:        0
Total transferred:      640000 bytes
HTML transferred:       55000 bytes
Requests per second:    1277.71 [#/sec] (mean)
Time per request:       0.783 [ms] (mean)
Time per request:       0.783 [ms] (mean, across all concurrent requests)
Transfer rate:          159.71 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       5
Processing:     0    0   0.2      0       5
Waiting:        0    0   0.2      0       4
Total:          0    1   0.3      1       5

Percentage of the requests served within a certain time (ms)
  50%      1
  66%      1
  75%      1
  80%      1
  90%      1
  95%      1
  98%      1
  99%      2
 100%      5 (longest request)

Swoole + php
docker run --rm jordi/ab ab  -n 5000 http://172.16.0.220:9501/
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 172.16.0.220 (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:        swoole-http-server
Server Hostname:        172.16.0.220
Server Port:            9501
Document Path:          /
Document Length:        28 bytes
Concurrency Level:      1
Time taken for tests:   12.821 seconds
Complete requests:      5000
Failed requests:        0
Total transferred:      955000 bytes
HTML transferred:       140000 bytes
Requests per second:    389.97 [#/sec] (mean)
Time per request:       2.564 [ms] (mean)
Time per request:       2.564 [ms] (mean, across all concurrent requests)
Transfer rate:          72.74 [Kbytes/sec] received
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   0.5      1      10
Processing:     1    2  14.3      1    1009
Waiting:        0    2  14.3      1    1008
Total:          1    2  14.3      2    1010
Percentage of the requests served within a certain time (ms)
  50%      2
  66%      2
  75%      2
  80%      3
  90%      3
  95%      4
  98%      6
  99%      7
 100%   1010 (longest request)
--------------------- https://blog.csdn.net/kexiaoling/article/details/80516097

swoole并没有你说的那么好,@韩天峰相关推荐

  1. 【SDCC讲师专访】Swoole开源项目创始人韩天峰:PHP是最好的编程语言

    摘要:SDCC 2015召开在即,大会前夕,笔者联系上了韩天峰,请他分享他与PHP的不解之缘并解读PHP的发展现状.关于PHP7和HHVM的性能之争,在他看来,PHP7才是未来的方向. 韩天峰,车轮互 ...

  2. PHP 异步并行编程_韩天峰

    2019独角兽企业重金招聘Python工程师标准>>> PHP 异步并行编程_韩天峰 韩天峰(Rango)多玩游戏平台技术负责人,swoole开源项目创始人.PHP的异步并行编程,介 ...

  3. 关于PHP程序员技术职业生涯规划--swool大神韩天峰

    关于PHP程序员技术职业生涯规划–swool大神韩天峰 看到很多PHP程序员职业规划的文章,都是直接上来就提Linux.PHP.MySQL.Nginx.Redis.Memcache.jQuery这些, ...

  4. 东北师范大学计算机学院晓辉,东北师范大学计算机科学与信息技术学院研究生导师简介-韩文峰...

    东北师范大学计算机科学与信息技术学院研究生导师简介-韩文峰东北师范大学 免费考研网/2016-04-15 姓名 韩文峰 职称 副教授 专业 计算机科学与技术 办公室 计算机科学与信息技术学院422室 ...

  5. 2019年8月23日 星期五(韩天峰的swoole)

    Swoole:面向生产环境的 PHP 异步网络通信引擎 使 PHP 开发人员可以编写高性能的异步并发 TCP.UDP.Unix Socket.HTTP,WebSocket 服务. Swoole 可以广 ...

  6. 韩天峰php教程,韩天峰 - Swoole4-全新的PHP编程模式

    展开查看详情 1.Swoole 4.0 PHP @hantianfeng Rango- 2.一. Go + Chan 全新协程编程模式 二. Swoole 4.0 新版本协程实现原理 三. Swoft ...

  7. 2017年PHP程序员未来路在何方——韩天峰

    PHP 从诞生到现在已经有20多年历史,从Web时代兴起到移动互联网退潮,互联网领域各种编程语言和技术层出不穷, Node.js . GO . Python 不断地在挑战 PHP 的地位.这些技术的推 ...

  8. 2019年7月2日 星期二(韩天峰的建议)

    我的编程之路轨迹就是 C语言(起始) -> Java(过客)-> PHP(主)-> C语言(终点). 编程语言专注于一个就行了,Java.PHP.Python.Ruby 任意一个都行 ...

  9. php级差,韩天峰(Rango)的博客

    很多纯PHP开发的后端框架中都使用了pcntl扩展提供的信号处理函数pcntl_signal,实际上这个函数的性能是很差的.首先看一段示例代码: declare(ticks = 1); pcntl_s ...

最新文章

  1. 电脑版java运行条件,Java Runtime Environment电脑版-Java Runtime Environment(Java运行环境)8.0.221 x64正式版-蜻蜓手游网...
  2. 亚马逊给警察局装备了人脸识别系统就万事大吉了?没那么容易
  3. Eclipse 导出
  4. 不要局限在完成当前飞鸽传书2009的简单思路上
  5. python ctime函数_Python time 模块
  6. JVM分代垃圾回收策略的基础概念
  7. [SDOI2013]直径
  8. idea ssm html增删改,intellij idea采用ssm框架实现的数据库增删查改demo
  9. oracle 数据库练习题及答案
  10. html5在线拍照,js html5 调用摄像头拍照
  11. 微信公众号网页跳转及获取用户信息的接口设计
  12. JDK7及早期版本Java HotSpot 虚拟机配置选项
  13. 使用spire.doc for java为word添加页码、文字水印、书签(去除警告信息)
  14. Qlikview连接Mysql数据源
  15. 深度图像修复的回顾和改进:使用生成对抗网络基于Patch的图像修复
  16. Selenium基础用法
  17. html屏幕遮挡,遮挡屏幕怎么设置 为什么手机上会出现请勿遮挡屏幕顶端
  18. ytb网站报错 “您没有联网,请检查网络连接”
  19. 基于STM32F103单片机的智能温室大棚RS485通信温湿度监测
  20. Sybase 时间处理Convert 的使用

热门文章

  1. 英语听力采用计算机化考试,北京英语听说考试2021年 北京英语听说机考满分
  2. 全球顶尖的程序化交易模型
  3. #51CTO学院四周年# 我和51cto的故事
  4. 计算日期差的方法c语言,C语言计算日期差的方法示例
  5. c语言课程设计挂科率高吗,有没有挂科的人指教下怎么让老师把成绩改高呢???...
  6. imprinted weights
  7. 本周内外盘行情回顾2022.2.27
  8. 网易mumu模拟器怎么清理缓存?
  9. 如何删除tmp计算机桌面,教你Win10系统中tmp文件删除不了应该如何解决?
  10. QT 自学内容 day03 listWidget ,treeWidget,tableWidget ,stackedWidget,模态,和非模态 多种 对话框的的使用