PHP7 SwooleNginxGolang三者性能对比,哪个更胜一筹?
- 内容介绍
- 文章标签
- 相关推荐
本文共计422个文字,预计阅读时间需要2分钟。
推荐(免费):PHP7+QPS对比:使用Apache bench工具对Nginx静态页、Golang Http程序、PHP7+Swoole Http程序进行压力测试。在同一台机器上,进行100次100万次Http请求的基本测试,QPS对比如下:
推荐(免费):PHP7
QPS对比
使用apache bench工具对Nginx静态页、Golang Http程序、PHP7+Swoole Http程序进行压力测试。在同一台机器上,进行并发100共100万次Http请求的基准测试中,QPS对比如下:
注:Nginx-1.9.9的测试中,已关闭access_log,启用open_file_cache缓存静态文件到内存
- 更详细的测试细节
- 历史测试数据:Nginx/Golang/Swoole/Node.js的性能对比
测试环境
- CPU:Intel® Core™ i5-4590 CPU @ 3.30GHz × 4
- 内存:16G
- 磁盘:128G SSD
- 操作系统:Ubuntu14.04 (Linux 3.16.0-55-generic)
压测工具
ab -c 100 -n 1000000 -k 127.0.0.1:8080/
VHOST配置
server { listen 80 default_server; root /data/webroot; index index.html; }
测试页面
<h1>Hello World!</h1>
进程数量
Nginx开启了4个Worker进程
htf@htf-All-Series:~/soft/php-7.0.0$ ps aux|grep nginx root 1221 0.0 0.0 86300 3304 ? Ss 12月07 0:00 nginx: master process /usr/sbin/nginx www-data 1222 0.0 0.0 87316 5440 ? S 12月07 0:44 nginx: worker process www-data 1223 0.0 0.0 87184 5388 ? S 12月07 0:36 nginx: worker process www-data 1224 0.0 0.0 87000 5520 ? S 12月07 0:40 nginx: worker process www-data 1225 0.0 0.0 87524 5516 ? S 12月07 0:45 nginx: worker process
Golang
测试代码
package main import ( "log" "net/www.1234xp.com/xiangshui.html 欢迎留下您的宝贵建议】
本文共计422个文字,预计阅读时间需要2分钟。
推荐(免费):PHP7+QPS对比:使用Apache bench工具对Nginx静态页、Golang Http程序、PHP7+Swoole Http程序进行压力测试。在同一台机器上,进行100次100万次Http请求的基本测试,QPS对比如下:
推荐(免费):PHP7
QPS对比
使用apache bench工具对Nginx静态页、Golang Http程序、PHP7+Swoole Http程序进行压力测试。在同一台机器上,进行并发100共100万次Http请求的基准测试中,QPS对比如下:
注:Nginx-1.9.9的测试中,已关闭access_log,启用open_file_cache缓存静态文件到内存
- 更详细的测试细节
- 历史测试数据:Nginx/Golang/Swoole/Node.js的性能对比
测试环境
- CPU:Intel® Core™ i5-4590 CPU @ 3.30GHz × 4
- 内存:16G
- 磁盘:128G SSD
- 操作系统:Ubuntu14.04 (Linux 3.16.0-55-generic)
压测工具
ab -c 100 -n 1000000 -k 127.0.0.1:8080/
VHOST配置
server { listen 80 default_server; root /data/webroot; index index.html; }
测试页面
<h1>Hello World!</h1>
进程数量
Nginx开启了4个Worker进程
htf@htf-All-Series:~/soft/php-7.0.0$ ps aux|grep nginx root 1221 0.0 0.0 86300 3304 ? Ss 12月07 0:00 nginx: master process /usr/sbin/nginx www-data 1222 0.0 0.0 87316 5440 ? S 12月07 0:44 nginx: worker process www-data 1223 0.0 0.0 87184 5388 ? S 12月07 0:36 nginx: worker process www-data 1224 0.0 0.0 87000 5520 ? S 12月07 0:40 nginx: worker process www-data 1225 0.0 0.0 87524 5516 ? S 12月07 0:45 nginx: worker process
Golang
测试代码
package main import ( "log" "net/www.1234xp.com/xiangshui.html 欢迎留下您的宝贵建议】

