当前位置:网站首页>web服务性能监控方案
web服务性能监控方案
2022-07-06 21:00:00 【季风泯灭的季节】
一、本地测试工具的使用
优点:
- 一次触发多次请求,且每个参数可动态变化,有利于弥补接口单个单元测试场景覆盖不足的问题
- 可以完成对接口性能的好怀定性检验,对接口性能测试作初步删选。
- 开发人员共同一个开发环境数据库,便于大家对所有微服务接口测试情况有一个直观全面的了解
缺陷:
- 本地机器性能各异,且无法控制并发线程数。导致接口测试的响应时间结果有较大波动,对接口性能好坏的程度做量化分析的结果数据并不可靠。
- 无法做接口的顺序链路调用测试一个模块的接口整体性能。
- 当接口入参依赖上一个接口的结果时,要想通过正则表达式保证一个期望的接口命中率,较为麻烦。
- 无法测出接口通过网关后的实际运行情况。
结论:
本地测试工具只适用于在接口开发接口,本地完成接口单元测试及初步的性能测试,想要完成接口性能的定量分析及接口调用的全链路分析,还得依赖其他工具。
二、 开发环境接口性能测试及监控
由于本地环境不稳定以及本地接口测试工具的短板存在,所以需要一个稳定的环境来部署其他工具弥补,这个环境最好是开发环境。
请求发送及监控工具jmeter
开发环境的请求发送工具使用jmeter,它正好可以弥补本地测试工具的不足,如:
- 可以生成对一个接口发送持续且稳定的并发数,测出接口TPS在稳定状态的值。
- 可以做到接口的顺序链路调用,测试整个模块的TPS值。
- 可以根据文件获取请求参数,提高接口的命中率。
请求链路分析工具skywalking
在请求过程中,如果发现某个接口TQS上不去,可用skywalking分析各个环节耗时。
Prometheus+Grafana监控性能指标
Jmeter监控
可以清楚的看到Jmeter的请求总次数、失败次数、TPS在接口调试过程中的变化趋势等信息
web应用监控
主要监控jvm使用情况和垃圾回收情况
Mysql监控
监控mysql的连接数、QPS、慢查询等情况
Redis监控
主要监控redis内存、网络IO、各个数据库的key值使用情况。
web应用性能分析工具Arthas
Prometheus+Grafana可以对web监控到jvm的使用情况和GC情况,但要分析具体原因还得借助Arthas。
如根据cpu使用情况分析线程状态
三、 接口测试步骤总结
本地测试:
通过本地接口测试工具完成单元测试,以及对性能测试的初步删选,如果接口测试结果无法达到查询300次/s,增删改100次/s,则上开发环境调试。
开发环境调试:
- 在开发环境部署jmeter、skywalking、Prometheus、Grafana等监控工具并配置相关监控参数。
- 使用jmeter对需要上开发环境调试的接口做并发请求,观察各个中间件及web服务的cpu使用情况,找出链路的性能瓶颈。
边栏推荐
- About Estimation Statistics
- Graphical tools package yolov5 and generate executable files exe
- When QT uses qtooltip mouse to display text, the picture of the button will also be displayed and the prompt text style will be modified
- [leetcode] 700 and 701 (search and insert of binary search tree)
- Baidu map JS development, open a blank, bmapgl is not defined, err_ FILE_ NOT_ FOUND
- Top 50 hit industry in the first half of 2022
- First understand the principle of network
- [leetcode] 450 and 98 (deletion and verification of binary search tree)
- RestClould ETL 社区版六月精选问答
- 链表面试常见题
猜你喜欢
21. (article ArcGIS API for JS) ArcGIS API for JS rectangular acquisition (sketchviewmodel)
The latest 2022 review of "small sample deep learning image recognition"
QT 打开文件 使用 QFileDialog 获取文件名称、内容等
qt-线程等01概念
VHDL实现任意大小矩阵加法运算
链表面试常见题
A 股指数成分数据 API 数据接口
VHDL implementation of arbitrary size matrix addition operation
Open3D 网格滤波
About Tolerance Intervals
随机推荐
19.(arcgis api for js篇)arcgis api for js线采集(SketchViewModel)
VHDL实现任意大小矩阵加法运算
Depth analysis of compilation constants, classloader classes, and system class loaders
Can the applet run in its own app and realize live broadcast and connection?
SSL证书部署
Gpt-3 is a peer review online when it has been submitted for its own research
Restcloud ETL Community Edition June featured Q & A
First understand the principle of network
CVPR 2022 best paper candidate | pip: six inertial sensors realize whole body dynamic capture and force estimation
23.(arcgis api for js篇)arcgis api for js椭圆采集(SketchViewModel)
[untitled]
24.(arcgis api for js篇)arcgis api for js点修改点编辑(SketchViewModel)
Ubuntu20 installation redisjson record
Kalman filter-1
Not All Points Are Equal Learning Highly Efficient Point-based Detectors for 3D LiDAR Point
腾讯云原生数据库TDSQL-C入选信通院《云原生产品目录》
[Dameng database] after backup and recovery, two SQL statements should be executed
浅谈网络安全之文件上传
预处理——插值
19. (ArcGIS API for JS) ArcGIS API for JS line acquisition (sketchviewmodel)