系统压测结果对比:tomcat/thinkphp/swoole/php-fpm/apache
【测试所用服务器8核,16G内存】
压测接口:
很简单,从一张表里根据主键随机查询出一条数据【数据库服务器和WEB服务器分开的】。
表数据量大概:910000+条。
这个测试结果很有趣:
tp5.0和3.2性能没有体现出较大的区别,不知道是不是因为测试太片面。相比原始PHP,性能确实下降得厉害。
JAVA的性能和原生PHP比,还差得不少。谁对JAVA很熟悉的能不能说说,是不是我的测试方法有什么没对,或者说太片面。
swoole有点牛逼。
测试:
ab -n -c http://127.0.0.1:xxxx/xxxx
Concurrency Level: 200
Complete requests: 50000
测试结果:
Server Software: swoole-http-server【swoole服务器+PHP,启动同CPU数量的进程】
Time taken for tests: 17.169 seconds
Requests per second: 2912.31 [#/sec] (mean)
CPU: +%
Server Software: wjt-php【Apache/2.4.12+自写的PHP框架,很简单,可等同于原生PHP】
Time taken for tests: 28.582 seconds
Requests per second: 1749.36 [#/sec] (mean)
CPU: +%
Server Software: tp3.2【Apache/2.4.12+thinkphp3.2】
Time taken for tests: 238.234 seconds
Time taken for tests: 230.307 seconds
Requests per second: 209.88 [#/sec] (mean)
Requests per second: 217.10 [#/sec] (mean)
CPU: % +
MEM: used
Server Software: tp3.2【php-fpm7.3+thinkphp3.2】
Time taken for tests: 202.025 seconds
Requests per second: 242.54 [#/sec] (mean)
Requests per second: 242.39 [#/sec] (mean)
CPU: % +
MEM: used
Server Software: tp5.0【apache+tinkphp5.0.20】
Time taken for tests: 220.431 seconds
Requests per second: 226.83 [#/sec] (mean)
CPU: % +
Server Software: Apache-Coyote/1.1【JAVA】
Time taken for tests: 49.743 seconds
Requests per second: 1005.17 [#/sec] (mean)
CPU: % +
附上测试命令:
swoole
/opt/lampp/bin/ab -n 10000 -c 50 'http://127.0.0.1:80098/test/ticket/index?clientId=41&type=ticket&orderId=118'
/opt/lampp/bin/ab -n 50000 -c 200 -k 'http://127.0.0.1:80098/test/ticket/test?clientId=41&type=ticket&orderId=118'
curl 'http://127.0.0.1:80098/test/ticket/test?clientId=41&type=ticket&orderId=118'
/opt/lampp/bin/ab -n 50000 -c 200 -k 'http://127.0.0.1:80098/index.php?m=spike&c=index&a=indexInfo&__clientId=41&__userId=27.10.195.49&__timestamp=15607601030000&__sign=ab5c8d8ce5d8c0713b80084f99b15fa32&id=906'
/opt/lampp/bin/ab -n 50000 -c 200 'http://127.0.0.1:80098/index.php?m=spike&c=index&a=indexInfo&__clientId=41&__userId=27.10.195.49&__timestamp=15607601030000&__sign=ab5c8d8ce5d8c0713b80084f99b15fa32&id=906'
/opt/lampp/bin/ab -n 50000 -c 200 'http://pwx.test.net/proxyToCommonService2/?m=spike&c=index&a=indexInfo&clientId=41&__clientId=41&__userId=27.10.195.49&__timestamp=15604545835783&__sign=54b36c10ba7cf3cc3529b8b570669ce6&id=906&'
curl "http://127.0.0.1:80098/index.php?m=spike&c=index&a=indexInfo&__clientId=41&__userId=27.10.195.49&__timestamp=15607601030000&__sign=ab5c8d8ce5d8c0713b80084f99b15fa32&id=906"
tp3.2 apache:prefork
/opt/lampp/bin/ab -n 10000 -c 50 'http://127.0.0.1:80071/index.php/test/index/test?clientId=41&type=ticket&orderId=118'
/opt/lampp/bin/ab -n 50000 -c 200 -k 'http://127.0.0.1:80071/index.php/test/index/test?clientId=41&type=ticket&orderId=118'
/opt/lampp/bin/ab -n 50000 -c 200 -k 'http://pwx.test.net/?m=spike&c=index&a=indexInfo&id=906&__clientId=41&__userId=27.10.195.49&__timestamp=1560911902&__sign=6e7904e3d8120dc9c6255cd6940f667a&clientId=41'
curl "http://pwx.test.net/?m=spike&c=index&a=indexInfo&id=906&__clientId=41&__userId=27.10.195.49&__timestamp=1560911902&__sign=6e7904e3d8120dc9c6255cd6940f667a&clientId=41"
tp3.2 php-fpm7.3
/opt/lampp/bin/ab -n 10000 -c 50 -k -r 'http://mp2.test.net/index.php?m=test3&a=test&clientId=41&type=ticket&orderId=118'
/opt/lampp/bin/ab -n 50000 -c 200 -k -r 'http://mp2.test/index.php?m=test3&a=test&clientId=41&type=ticket&orderId=118'
wjt-php
/opt/lampp/bin/ab -n 10000 -c 50 -k 'http://127.0.0.1:80077/index.php?m=Test&a=sql&clientId=41&type=ticket&orderId=118'
/opt/lampp/bin/ab -n 50000 -c 200 -k 'http://127.0.0.1:80077/index.php?m=Test&a=sql&clientId=41&type=ticket&orderId=118'
curl 'http://127.0.0.1:80077/index.php?m=Test&a=sql&clientId=41&type=ticket&orderId=118'
tp5
/opt/lampp/bin/ab -n 10000 -c 50 'http://127.0.0.1:80076/index.php/Test/index/index?clientId=41&type=ticket&orderId=118'
/opt/lampp/bin/ab -n 50000 -c 200 -k 'http://127.0.0.1:80076/index.php/Test/index/index?clientId=41&type=ticket&orderId=118'
curl 'http://127.0.0.1:80076/index.php/Test/index/index?clientId=41&type=ticket&orderId=118'
JAVA
/opt/lampp/bin/ab -n 10000 -c 50 'http://127.0.0.1:80082/ticket/test'
/opt/lampp/bin/ab -n 50000 -c 200 'http://127.0.0.1:80082/ticket/test'
/opt/lampp/bin/ab -n 50000 -c 200 -k 'http://127.0.0.1:80082/ticket/test'
curl 'http://127.0.0.1:80082/ticket/test'
系统压测结果对比:tomcat/thinkphp/swoole/php-fpm/apache的更多相关文章
- (转)一次压测对nginx/tomcat配置的调整
原文地址:还在寻找.... 一个web系统,前端使用nginx做为反向代理,处理https,并将请求转发给后端的tomcat服务. 压力测试工具选择了jmeter. 首先简单介绍一下jmeter. 它 ...
- my31_MGR单写模式压测以及对比普通从库记录
场景MGR单写模式三节点,db46写节点,db47/db48为读节点工具sysbencn.压测15个小时,db46上18线程纯写,12线程oltp混合测试,db48上12线程select在压测2个小时 ...
- 案例 | 荔枝微课基于 kubernetes 搭建分布式压测系统
王诚强,荔枝微课基础架构负责人.热衷于基础技术研发推广,致力于提供稳定高效的基础架构,推进了荔枝微课集群化从0到1的发展,云原生架构持续演进的实践者. 本文根据2021年4月10日深圳站举办的[腾讯云 ...
- 压测 swoole_websocket_server 性能
概述 这是关于 Swoole 入门学习的第十篇文章:压测 swoole_websocket_server 性能. 第九篇:Swoole Redis 连接池的实现 第八篇:Swoole MySQL 连接 ...
- ESRally压测ElasticSearch性能 CentOS 7.5 安装 Python3.7
1,CentOS 7.5 安装 Python3.7 1.安装开发者工具 yum -y groupinstall "Development Tools"2.安装Python编译依赖包 ...
- docker内存监控与压测
一直运行的docker容器显示内存已经耗尽,并且容器内存耗尽也没出现重启情况,通过后台查看发现进程没有占用多少内存.内存的监控使用的是cadvisor,计算方式也是使用cadvisor的页面计算方式, ...
- python压测工具Locust
python压测工具Locust Locust介绍 Locust作为基于Python语言的性能测试框架. 其优点在于他的并发量可以实现单机10倍于LoadRunner和Jmeter工具.他的工作原理为 ...
- Jmeter与压测相关概念
相关概念 RT(response time) 什么是RT? RT就是指系统在接收到请求和做出相应这段时间跨度 但是值得一提的是RT的值越高,并不真的就能说明我们的系统的吞吐量就很高, 比如说,如果存在 ...
- (八)使用 jmh 压测 Dubbo
1.JMH简介 JMH即Java Microbenchmark Harness,是Java用来做基准测试的一个工具,该工具由OpenJDK提供并维护,测试结果可信度高. 相对于 Jmeter.ab , ...
随机推荐
- Android源码分析(十二)-----Android源码中如何自定义TextView实现滚动效果
一:如何自定义TextView实现滚动效果 继承TextView基类 重写构造方法 修改isFocused()方法,获取焦点. /* * Copyright (C) 2015 The Android ...
- kubernetes集群内通过endpoint访问外部服务
kubernetes内的服务访问集群外独立的服务最好通过endpoint方式,例如MySQL 1.创建mysql-service.yaml apiVersion: v1 kind: Service m ...
- Fundebug 微信小程 BUG 监控插件更新至 1.2.1,优化错误上报次数的限制算法,新增 silentHttpHeader 配置选项
摘要: 1.2.1优化错误上报次数的限制算法,新增silentHttpHeader配置选项,请大家及时更新哈! Fundebug提供专业的微信小程序 BUG 监控服务,可以第一时间为您捕获生存环境中小 ...
- passwd修改密码失败,报鉴定令牌操作错误
出现这个情况,从四个方面来分析: 1./usr/bin/passwd 的权限中没有添加s即SUID特殊权限 即:-rwxr-xr-x. 1 root root 27000 8月 22 2010 /u ...
- CPU使用率与负载的爱恨情仇
今天有一个电话面试,面试官问我:CentOS怎么查看CPU负载?我说:看top的第一行有load average.面试官又问:为什么从这就判定是负载高呢?依据是什么呢?然后... 然后我就尴尬了,挂了 ...
- Flutter gradle采坑
前些日子google推出Flutter1.9版本支持web果断升级 在运行flutter时发现错误,错误提示为 Launching lib/main.dart on Android SDK built ...
- 前几天去电脑城升级了下主机配置(酷睿i3-9100F)
因为自用电脑配置有点儿低了,前几天路过电脑城正好顺便升级下主机配置. 平时又不玩儿什么游戏,只是简单的使用,于是酷睿i3-9100F就成为了我的选择. 酷睿i3-9100F 四核四线程,不带核显(GP ...
- 仿照addCleanup 在unittest中清理addSetupclass资源
addCleanup的用例这里不介绍了,可以看我的另一编文章: python unittest框架中addCleanup函数详解 但如果有下面这种场景,还是会遗留大批理资源 在setUpClass注入 ...
- JDOJ 1606 数字三角形
JDOJ 1606: 数字三角形 JDOJ传送门 Description 输入n,输出n的数字三角形 见样例 Input n Output n的数字三角形 Sample Input 4 Sample ...
- 第二阶段冲刺(个人)——four
今天的的计划:选择功能界面的背景设计,使得整体效果看上去吸引眼球. 昨天做了什么?选择功能界面的选择框排版设计. 遇到的困难: 还是js的函数 设计,思路不是很清晰.