【测试所用服务器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. Keepalived与MySQL互为主从自动切换配置

    为解决Mysql数据库单点问题,实现两台MySQL数据库互为主备,双向replication.当一Master出现问题,则将Slave切换为Master继续工作. 环境说明 系统版本:CentOS L ...

  2. JavaScript的Proxy可以做哪些有意思的事儿

    摘要: 神奇而有趣的Proxy. 原文:拿Proxy可以做哪些有意思的事儿 作者:贾顺名 Fundebug经授权转载,版权归原作者所有. Proxy是什么 首先,我们要清楚,Proxy是什么意思,这个 ...

  3. spring项目使用mave将第三方jar包打进war包中

    背景:一个标准的ssm项目,需要使用到第三方jar,现需要将项目发布到liunx的服务器上,将项目打成war包,第三方war包也需要打进去 首先是直接打包,发现第三方jar包并没有打进去......蛋 ...

  4. 源码解析 || ArrayList源码解析

    前言 这篇文章的ArrayList源码是基于jdk1.8版本的源码,如果与前后版本的实现细节出现不一致的地方请自己多加注意.先上一个它的结构图 ArrayList作为一个集合工具,对于我而言它值得我们 ...

  5. vue - 基础(3)

    1.数据的双向绑定 <!DOCTYPE html> <html lang="en"> <head> <meta charset=" ...

  6. CSS伪类选择器:is、not

    本文介绍一下Css伪类:is和:not,并解释一下is.not.matches.any之前的关系 :not The :not() CSS pseudo-class represents element ...

  7. Redash - 安装和初试

    前言 当业务成长到一定规模之后,会有许多想看各种不同类型报表的需求,如果单独做在后台,那么无疑会浪费前端和后端开发的时间.所以一直都有在寻找一款好用的BI工具.后面查了一下,市面上好用的一些非商业的B ...

  8. 01-linux-基本语法-sh文件

    在一些开源库中,往往有一个 xxx.sh 的安装文件.命令“./ xxx.sh” 就可运行之. 其实内部是一些 linux 的语句.整合起来,方便使用而已. 介绍一下常用的一些Linux语句 cd b ...

  9. python 文本全选

    这个是一个控制框有效果 # encoding: utf-8 from Tkinter import * def printentry(event): print("click on" ...

  10. LIST OF BEST OPEN SOURCE BLOCKCHAIN PLATFORMS

    https://www.blockchain-council.org/blockchain/list-of-best-open-source-blockchain-platforms/ Open so ...