使用命令 ab -c 20000 -n 100000 'http://127.0.0.1:9050/v1/api.store.xxx'进行压测,并同时进行了交叉测试,结果如下:

  1. 高并发情况下数据目前没有出错。
  2. Redis性能和框架封装的Cache性能差的不多。

1. Redis

1.1. Redis自增

ab -c 20000 -n 100000 'http://127.0.0.1:9050/v1/api.store.redis.add'

This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 127.0.0.1 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests Server Software: swoole-http-server
Server Hostname: 127.0.0.1
Server Port: 9050 Document Path: /v1/api.store.redis.add
Document Length: 7 bytes Concurrency Level: 20000
Time taken for tests: 92.729 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 24100000 bytes
HTML transferred: 700000 bytes
Requests per second: 1078.41 [#/sec] (mean)
Time per request: 18545.834 [ms] (mean)
Time per request: 0.927 [ms] (mean, across all concurrent requests)
Transfer rate: 253.81 [Kbytes/sec] received Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 137 278.1 0 871
Processing: 492 16527 4273.2 18148 19270
Waiting: 2 16527 4273.3 18148 19270
Total: 873 16664 4019.2 18151 19270 Percentage of the requests served within a certain time (ms)
50% 18151
66% 18202
75% 18393
80% 18652
90% 18869
95% 19017
98% 19128
99% 19253
100% 19270 (longest request)

经验证,数据从0自增到100000正常。

1.2. Redis自减

ab -c 20000 -n 100000 'http://127.0.0.1:9050/v1/api.store.redis.sub'

This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 127.0.0.1 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests Server Software: swoole-http-server
Server Hostname: 127.0.0.1
Server Port: 9050 Document Path: /v1/api.store.redis.sub
Document Length: 7 bytes Concurrency Level: 20000
Time taken for tests: 93.422 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 24100000 bytes
HTML transferred: 700000 bytes
Requests per second: 1070.41 [#/sec] (mean)
Time per request: 18684.485 [ms] (mean)
Time per request: 0.934 [ms] (mean, across all concurrent requests)
Transfer rate: 251.92 [Kbytes/sec] received Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 134 271.5 0 852
Processing: 477 16660 4230.2 18030 19399
Waiting: 8 16660 4230.3 18030 19399
Total: 861 16793 3990.8 18034 19828 Percentage of the requests served within a certain time (ms)
50% 18034
66% 18205
75% 18784
80% 18824
90% 19057
95% 19136
98% 19383
99% 19389
100% 19828 (longest request)

经验证,数据从100000自减到0正常。

1.3. Redis读

ab -c 20000 -n 100000 'http://127.0.0.1:9050/v1/api.store.redis.read'

This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 127.0.0.1 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests Server Software: swoole-http-server
Server Hostname: 127.0.0.1
Server Port: 9050 Document Path: /v1/api.store.redis.read
Document Length: 1 bytes Concurrency Level: 20000
Time taken for tests: 91.817 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 23500000 bytes
HTML transferred: 100000 bytes
Requests per second: 1089.12 [#/sec] (mean)
Time per request: 18363.456 [ms] (mean)
Time per request: 0.918 [ms] (mean, across all concurrent requests)
Transfer rate: 249.94 [Kbytes/sec] received Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 132 269.6 0 870
Processing: 447 16350 4296.6 18157 18442
Waiting: 2 16350 4296.6 18157 18442
Total: 872 16483 4046.5 18159 18488 Percentage of the requests served within a certain time (ms)
50% 18159
66% 18257
75% 18284
80% 18295
90% 18341
95% 18373
98% 18392
99% 18414
100% 18488 (longest request)

2. Cache

2.1 cache自增
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 127.0.0.1 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests Server Software: swoole-http-server
Server Hostname: 127.0.0.1
Server Port: 9050 Document Path: /v1/api.store.cache.incre
Document Length: 7 bytes Concurrency Level: 20000
Time taken for tests: 94.379 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 24100000 bytes
HTML transferred: 700000 bytes
Requests per second: 1059.56 [#/sec] (mean)
Time per request: 18875.762 [ms] (mean)
Time per request: 0.944 [ms] (mean, across all concurrent requests)
Transfer rate: 249.37 [Kbytes/sec] received Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 126 260.1 0 1004
Processing: 378 16806 4456.7 18287 19877
Waiting: 10 16806 4456.7 18287 19877
Total: 876 16932 4213.5 18288 19877 Percentage of the requests served within a certain time (ms)
50% 18288
66% 18595
75% 18758
80% 19491
90% 19786
95% 19801
98% 19819
99% 19846
100% 19877 (longest request)

经验证,数据从0自增到100000正常。

2.2 cache自减

ab -c 20000 -n 100000 'http://127.0.0.1:9050/v1/api.store.cache.decre'

This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 127.0.0.1 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests Server Software: swoole-http-server
Server Hostname: 127.0.0.1
Server Port: 9050 Document Path: /v1/api.store.cache.decre
Document Length: 7 bytes Concurrency Level: 20000
Time taken for tests: 94.499 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 24100000 bytes
HTML transferred: 700000 bytes
Requests per second: 1058.21 [#/sec] (mean)
Time per request: 18899.832 [ms] (mean)
Time per request: 0.945 [ms] (mean, across all concurrent requests)
Transfer rate: 249.05 [Kbytes/sec] received Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 138 281.8 0 900
Processing: 463 16846 4138.5 18405 19427
Waiting: 14 16846 4138.6 18405 19427
Total: 914 16984 3881.6 18407 19556 Percentage of the requests served within a certain time (ms)
50% 18407
66% 18558
75% 18638
80% 18834
90% 18901
95% 18914
98% 19106
99% 19329
100% 19556 (longest request)

经验证,数据从100000自减到0正常。

2.3 cache读

ab -c 20000 -n 100000 'http://127.0.0.1:9050/v1/api.store.cache.read'

This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 127.0.0.1 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests Server Software: swoole-http-server
Server Hostname: 127.0.0.1
Server Port: 9050 Document Path: /v1/api.store.cache.read
Document Length: 1 bytes Concurrency Level: 20000
Time taken for tests: 93.918 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 23500000 bytes
HTML transferred: 100000 bytes
Requests per second: 1064.76 [#/sec] (mean)
Time per request: 18783.576 [ms] (mean)
Time per request: 0.939 [ms] (mean, across all concurrent requests)
Transfer rate: 244.35 [Kbytes/sec] received Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 115 241.4 0 854
Processing: 314 16709 4411.4 18350 19034
Waiting: 2 16709 4411.5 18350 19034
Total: 856 16825 4180.4 18371 19034 Percentage of the requests served within a certain time (ms)
50% 18371
66% 18664
75% 18796
80% 18868
90% 18962
95% 18980
98% 18999
99% 19007
100% 19034 (longest request)

Lumen框架使用Redis与框架Cache压测比较的更多相关文章

  1. 实现理论上无tps上限的分布式压测(基于Jmeter+InfluxDB+Grafana+Spring Boot)

    JMeter自身带有Master-Slave压测框架,对于并发量不是很高的压力情况下(比如tps低于5000),该方案是可行的,并且使用起来非常方便,只要在配置文件或者命令行工具的参数做一些补充,即可 ...

  2. 【Java分享客栈】未来迈向高级工程师绕不过的技能:JMeter压测

    前言 因为工作需要,久违的从自己的有道云笔记中去寻找压测相关的内容,翻开之后发现还不错,温故一遍后顺便整理出来分享给大家. 题外话,工作8年多,有道云笔记不知不觉都6G多了,扫一眼下来尽是云烟过往,竟 ...

  3. 6. 堪比JMeter的.Net压测工具 - Crank 实战篇 - 收集诊断跟踪信息与如何分析瓶颈

    目录 堪比JMeter的.Net压测工具 - Crank 入门篇 堪比JMeter的.Net压测工具 - Crank 进阶篇 - 认识yml 堪比JMeter的.Net压测工具 - Crank 进阶篇 ...

  4. 从零开始搭建框架SSM+Redis+Mysql(二)之MAVEN项目搭建

    从零开始搭建框架SSM+Redis+Mysql(二)之MAVEN项目搭建 废话不说,直接撸步骤!!! 1.创建主项目:ncc-parent 选择maven创建项目,注意在创建项目中,packing选择 ...

  5. 从零开始搭建框架SSM+Redis+Mysql(一)之摘要

    从零开始搭建框架SSM+Redis+Mysql(一)之摘要 本文章为本人实际的操作后的回忆笔记,如果有步骤错漏,希望来信307793969@qq.com或者评论指出. 本文章只体现过程,仅体现操作流程 ...

  6. SSM-1第一章 认识SSM框架和Redis

    第一章 认识SSM框架和Redis   1.1 Spring框架 Sring理念  Ioc  控制反转  IOC是一个容器,在Spring中,它会认为一切Java资源都是JavaBean,容器的目标是 ...

  7. 对于redis底层框架的理解(一)

    近期学习了redis底层框架,好多东西之前都没听说过,算是大开眼界了. 先梳理下redis正常的通讯流程吧 首先服务器启动都有主函数main,这个main函数就在redis.c里 首先是initser ...

  8. 恋恋风辰 对于redis底层框架的理解(一)

    近期学习了redis底层框架,好多东西之前都没听说过,算是大开眼界了. 先梳理下redis正常的通讯流程吧 首先服务器启动都有主函数main,这个main函数就在redis.c里 首先是initser ...

  9. thinkphp5 yii2 laravel5.1 框架性能压测对比图

    nginx+php7环境,opcache已经开启,每测试一个框架都重启服务器并且预热访问三次,压测工具ab.exe. laravel,thinkphp,yii都已关闭debug,该做的优化命令都搞了, ...

随机推荐

  1. 【Alpha】Scrum Meeting 7

    目录 前言 任务分配 燃尽图 会议照片 签入记录 困难 前言 第7次会议在4月11日19:00由PM在教一317召开. 交流确认了任务进度,对下一阶段任务进行分配.时长60min. 任务分配 姓名 当 ...

  2. Python-王者荣耀自动刷金币+爬取英雄信息+图片

    前提:本文主要功能是 1.用python代刷王者荣耀金币 2.爬取英雄信息 3.爬取王者荣耀图片之类的. (全部免费附加源代码) 思路:第一个功能是在基于去年自动刷跳一跳python代码上面弄的,思路 ...

  3. 利用JS模拟排队系统

    我爱撸码,撸码使我感到快乐!大家好,我是Counter.今天给大家分享的是js模拟排队系统,刚开始有排队序列,序列里有vip用户和普通用户,vip用户永远位于普通用户的前面,只有当当前vip用户都办理 ...

  4. SQL Server監控与診斷

    僅為記錄工作中遇到的問題. 1. 字符串截斷: SQL server里很多job用於運行DTS,經常會收到系統出錯警報,如: ...String ) The statement has been te ...

  5. j2ee课程设计—基于activiti的请休假系统

    前言 课设基于SSM框架,数据库采用mysql,主要业务交给activiti,版本控制利用github. 参考资料: Intellij 部署SSM框架 Activiti就是这么简单 方大师的教材 下文 ...

  6. Centos 6.6 安装

    说明:使用VMware进行安装.安装VMware软件及创建虚拟机步骤省略,从正式安装开始. 1.开启虚拟机后稍等,直到出现如下界面: 2.选择第一项,进入光盘介质检查界面. 一般直接跳过点击skip, ...

  7. tomcat中显示本地图片①(未解决)

    <本模块文仅作为学习过程中的自我总结,有需要可参看,欢迎指导与提出建议,很多地方可能断章取义,理解不到位,虚心求学.谢谢!> 资料查阅原因:2018/7/10(做项目中显示详情页面,从数据 ...

  8. ArcGIS Pro开发Web3D应用(1)——环境搭建与初始实例

    1.搭建环境 1.1 ArcGIS Web3D软件环境 ArcGIS Pro 2.0(必须) ArcGIS for Enterprise 10.5.1 (从10.5开始称呼为Enterprise)包括 ...

  9. [Linux]安装pyenv

    python多版本管理pyenv 网址:https://blog.csdn.net/yingfeng_yang/article/details/82527321 Ubuntu16.04安装pyenv1 ...

  10. MariaDB主从复制,redis发布订阅,持久化,以及主从同步

      一. MariaDB主从复制 mysql基本操作 1 连接数据库 mysql -u root -p -h 127.0.0.1 mysql -u root -p -h 192.168.12.60 2 ...