当前位置:网站首页>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 [对象编号]
边栏推荐
- How much money have I made by sticking to fixed investment for 3 years?
- Question B of the East China Cup: how to establish a population immune barrier against novel coronavirus?
- [wechat applet full stack development course] course directory (mpvue+koa2+mysql)
- What functions should smart agriculture applet system design have
- 字符串 实现 strStr()
- x86的编码格式
- Jetpack compose layout (IV) - constraintlayout
- 8、智慧交通项目(1)
- Grabcut image segmentation in opencv
- Remove the mosaic, there's a way, attached with the running tutorial
猜你喜欢

MongoDB的原理、基本使用、集群和分片集群

Redis(一)原理与基本使用

Wechat official account can reply messages normally, but it still prompts that the service provided by the official account has failed. Please try again later

2022 postgraduate entrance examination experience post -- Alibaba Business School of Hangzhou Normal University -- management science and Engineering (including the recommendation of books and course

Kotlin advanced generic

8. Intelligent transportation project (1)

I put a two-dimensional code with rainbow candy

Exception: gradle task assemblydebug failed with exit code 1

Jetpack compose layout (II) - material components and layout

Remittance international empowers cross-border e-commerce: to be a compliant cross-border payment platform!
随机推荐
[MySQL learning notes 22] index
Question B of the East China Cup: how to establish a population immune barrier against novel coronavirus?
Methodchannel of flutter
STM32 receives data by using idle interrupt of serial port
Flutter dialog: cupertinoalertdialog
【mysql学习笔记21】存储引擎
Can two Mitsubishi PLC adopt bcnettcp protocol to realize wireless communication of network interface?
[Ruby on rails full stack course] course directory
力扣-104. 二叉树的最大深度
瑞萨RA系列-开发环境搭建
Title B of the certification cup of the pistar cluster in the Ibagu catalog
Processing picture class library
Jetpack compose layout (I) - basic knowledge of layout
字符串 实现 strStr()
x86电脑上下载debian的arm64的包
Redis(二)分布式锁与Redis集群搭建
Data-driven anomaly detection and early warning of 21 May Day C
Jetpack compose layout (III) - custom layout
Why should the terminal retail industry choose the member management system
Cubemx stm32f105rb USB flash drive reading and writing detailed tutorial