【测试所用服务器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的更多相关文章

  1. (转)一次压测对nginx/tomcat配置的调整

    原文地址:还在寻找.... 一个web系统,前端使用nginx做为反向代理,处理https,并将请求转发给后端的tomcat服务. 压力测试工具选择了jmeter. 首先简单介绍一下jmeter. 它 ...

  2. my31_MGR单写模式压测以及对比普通从库记录

    场景MGR单写模式三节点,db46写节点,db47/db48为读节点工具sysbencn.压测15个小时,db46上18线程纯写,12线程oltp混合测试,db48上12线程select在压测2个小时 ...

  3. 案例 | 荔枝微课基于 kubernetes 搭建分布式压测系统

    王诚强,荔枝微课基础架构负责人.热衷于基础技术研发推广,致力于提供稳定高效的基础架构,推进了荔枝微课集群化从0到1的发展,云原生架构持续演进的实践者. 本文根据2021年4月10日深圳站举办的[腾讯云 ...

  4. 压测 swoole_websocket_server 性能

    概述 这是关于 Swoole 入门学习的第十篇文章:压测 swoole_websocket_server 性能. 第九篇:Swoole Redis 连接池的实现 第八篇:Swoole MySQL 连接 ...

  5. ESRally压测ElasticSearch性能 CentOS 7.5 安装 Python3.7

    1,CentOS 7.5 安装 Python3.7 1.安装开发者工具 yum -y groupinstall "Development Tools"2.安装Python编译依赖包 ...

  6. docker内存监控与压测

    一直运行的docker容器显示内存已经耗尽,并且容器内存耗尽也没出现重启情况,通过后台查看发现进程没有占用多少内存.内存的监控使用的是cadvisor,计算方式也是使用cadvisor的页面计算方式, ...

  7. python压测工具Locust

    python压测工具Locust Locust介绍 Locust作为基于Python语言的性能测试框架. 其优点在于他的并发量可以实现单机10倍于LoadRunner和Jmeter工具.他的工作原理为 ...

  8. Jmeter与压测相关概念

    相关概念 RT(response time) 什么是RT? RT就是指系统在接收到请求和做出相应这段时间跨度 但是值得一提的是RT的值越高,并不真的就能说明我们的系统的吞吐量就很高, 比如说,如果存在 ...

  9. (八)使用 jmh 压测 Dubbo

    1.JMH简介 JMH即Java Microbenchmark Harness,是Java用来做基准测试的一个工具,该工具由OpenJDK提供并维护,测试结果可信度高. 相对于 Jmeter.ab , ...

随机推荐

  1. Vue axios异步获取后台数据alert提示undefined

    记录一个小问题,关于分页查询套餐 前台通过axios异步请求获取后台数据alert弹出数据提示undefined 下面有三个bean PageResult /** * 分页结果封装对象 */ publ ...

  2. Ubuntu Pycharm下deeplab ImportError: cannot import name 'monitoring'

    1.使用pycharm运行deeplab过程中出现ImportError: cannot import name 'monitoring' 2.把root用户及非root用户中pip安装的tensor ...

  3. Linux CentOS 6.5 ifconfig查询不到ip简单解决方法

    最近有小伙伴表示在虚拟机中安装CentOS之后使用ifconfig以及ip addr指令无法查询到ip地址, 在此笔者提供一个简单有效的方法; 1. 切换为root用户登录 su root 2.进入配 ...

  4. STL杂记

    STL介绍: 我所理解的stl: 容器: 是一种数据结构,如list,vector,和deques ,以模板类的方法提供.为了访问容器中的数据,可以使用由容器类输出的迭代器: 算法:  是用来操作容器 ...

  5. centos下的python无法打印中文

    Python3中输出中文的方法如下: 方法一:在环境变量中,设置PYTHONIOENCODING=utf-8 以centos为例执行: export PYTHONIOENCODING=utf-8 方法 ...

  6. python字典中显示中文

    #coding=utf-8import jsondict={'title':"这是中文"}print json.dumps(dict,ensure_ascii=False,enco ...

  7. Kdevelop的安装-2种方法

    使用 Ubuntu 的自带的源: sudo apt-get update sudo apt-get install kdevelop 这就可以了.update这部,假如不换源,更新非常慢.换源方法很简 ...

  8. FFT和NTT学习笔记_基础

    FFT和NTT学习笔记 算法导论 参考(贺) http://picks.logdown.com/posts/177631-fast-fourier-transform https://blog.csd ...

  9. T1 :最小值(min)题解 ——2019.10.15

    思路: 对于 % 30 的数据,可以想到一个 Dp 方程: 其中dp[i]表示分割[1,i]的最大答案 代码: #include<cstdio> #include<cstring&g ...

  10. Nothing to say

    1. This moment will nap, you will have a dream; but this moment study, you will interpret a dream.此刻 ...