当前位置:网站首页>NetCore性能排查
NetCore性能排查
2022-06-25 09:37:00 【@@Mr.Fu】
文章目录
一、性能排查
性能的概念
性能的来源于系统。
系统分为两类:web系统【BS】和客户端【桌面】系统【CS】。
性能的指标根据
两个根据:
数量 客户端执行接口的数量,也就是1秒钟能执行多少个请求接口,处理的越多,性能越高。
时间 从客户端请求到服务端并响应请求产生的时间称之为 性能时间;时间越短性能越高。
如图:

时间和数量是一个矛盾关系:时间越短执行的数量越多【吞吐量】,时间越长执行的数量越少。
性能的起点在于执行一次接口的执行时间。
获取系统接口执行时间
工具:
- Apche JMeter 【常用】
- ApcheBench(ab)命令行工具【常用】
- Gatling
- K6
- Locust
- West Wind WebSurge
- Netling
- Vegeta
- NBomber
性能诊断
工具
- VS自带的性能探测器
CPU使用率上升的原因
while for循环
解决方案:使用Hash表寻存储数据
文件操作
解决方案:异步IO DoNetty
网络连接和网络数据传输
解决方案:使用缓存的方式存储数据 或者 使用异步IO多路复用机制
CPU使用率上升的缺陷:
处理接口并发量的能力下降
系统的吞吐量下降
性能排查落地
条件
- NET CORE 3.1 SDK 或 更高级版本
- dotnet-counters 检查托管内存的使用情况
- dotnet-dump 收集和分析转储文件
步骤
创建内存溢出项目
安装dotnet-counters 准备
dotnet tool install --global dotnet-counters找到进程编号
dotnet-counters ps监视进程
dotnet-counters monitor --refresh-interval 1 -p [进程编号]最后查看显示统计信息
找到GC Heap Size 统计这个程序的增长,为了找出内存溢出的代码。
dotnet-dump 安装
dotnet tool install --global dotnet-dump然后执行项目接口
运行项目
生成转储文件
dotnet-dump collect -p [进程编号]然后分析转储文件
dotnet-dump analyze [转储文件名称]开始分析
dumpheap -stat分析类型的具体对象
dumpheap -mt [类型编号]找出应用根
gcroot -all [对象编号]
边栏推荐
- Remittance international empowers cross-border e-commerce: to be a compliant cross-border payment platform!
- JS tool function, self encapsulating a throttling function
- MySQL source code reading (II) login connection debugging
- What functions should smart agriculture applet system design have
- ‘Flutter/Flutter. h‘ file not found
- Shuttle JSON, list, map inter transfer
- Why should the terminal retail industry choose the member management system
- Data-driven anomaly detection and early warning of item C in the May 1st mathematical modeling competition in 2021
- [buuctf.reverse] 117-120
- x86的编码格式
猜你喜欢

Modbus协议与SerialPort端口读写

Vscode attempted to write the procedure to a pipeline that does not exist

manhattan_ Slam environment configuration

Chitubox micromake l3+ slicing software configuration correspondence
![[matlab] image binarization (imbinarize function)](/img/3e/066f460d9f436bbc43ea35e46093e2.jpg)
[matlab] image binarization (imbinarize function)

CyCa children's physical etiquette Yueqing City training results assessment successfully concluded

可穿戴设备或将会泄露个人隐私

Rxjs TakeUntil 操作符的学习笔记

Huipay international permet au commerce électronique transfrontalier de devenir une plate - forme de paiement transfrontalière conforme!

Learning notes of rxjs takeuntil operator
随机推荐
Kotlin advanced set
STM32 receives data by using idle interrupt of serial port
NFC read / write mode development - book summary
Wearable devices may reveal personal privacy
[zero foundation understanding innovation and entrepreneurship competition] overall cognition and introduction of mass entrepreneurship and innovation competition (including FAQs and integration of bl
如何自制一个安装程序,将程序打包生成安装程序的办法
[buuctf.reverse] 117-120
Solution to the problem of repeated startup of esp8266
2台三菱PLC走BCNetTCP协议,能否实现网口无线通讯?
Kotlin common standard functions
Ruiji takeout project (II)
Learning notes of rxjs takeuntil operator
【mysql学习笔记20】mysql体系结构
字符串 实现 strStr()
[wechat applet full stack development course] course directory (mpvue+koa2+mysql)
‘Flutter/Flutter. h‘ file not found
8、智慧交通项目(1)
Jetpack compose layout (II) - material components and layout
How to make a self-made installer and package the program to generate an installer
Repo sync will automatically switch the correspondence between the local branch and the remote branch - how to customize this behavior