当前位置:网站首页>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 [对象编号]
边栏推荐
- Opencv中的GrabCut图像分割
- Etcd tutorial - Chapter 4 etcd cluster security configuration
- Flutter replaces the default icon of Gaud positioning
- An auxiliary MVP architecture project quick development library -mvpfastdagger
- Kotlin advanced generic
- What functions should smart agriculture applet system design have
- pmp考试题型需要注意哪些?
- Pytorch_ Geometric (pyg) uses dataloader to report an error runtimeerror: sizes of tenants must match except in dimension 0
- Encoding format for x86
- Flutter dialog: cupertinoalertdialog
猜你喜欢
Can two Mitsubishi PLC adopt bcnettcp protocol to realize wireless communication of network interface?
Consul的基本使用与集群搭建
纳米数据世界杯数据接口,中超数据,体育数据比分,世界杯赛程api,足球比赛实时数据接口
汇付国际为跨境电商赋能:做合规的跨境支付平台!
Etcd tutorial - Chapter 4 etcd cluster security configuration
8、智慧交通项目(1)
[MySQL learning notes 22] index
MongoDB的原理、基本使用、集群和分片集群
Question B of the East China Cup: how to establish a population immune barrier against novel coronavirus?
Is it harder to find a job in 2020? Do a good job in these four aspects and find a good job with high salary
随机推荐
Etcd教程 — 第四章 Etcd集群安全配置
8、智慧交通项目(1)
Simple waterfall effect
Best producer consumer code
Etcd tutorial - Chapter 4 etcd cluster security configuration
manhattan_slam环境配置
PMP考试多少分算通过?
How to "transform" small and micro businesses (I)?
Repo sync will automatically switch the correspondence between the local branch and the remote branch - how to customize this behavior
[zero foundation understanding innovation and entrepreneurship competition] overall cognition and introduction of mass entrepreneurship and innovation competition (including FAQs and integration of bl
Minio基本使用与原理
Puzzle (019.2) hexagonal lock
Nano data World Cup data interface, CSL data, sports data score, world cup schedule API, real-time data interface of football match
oracle 函数 触发器
How do dating applets make millions a year? What is the profit model?
2021mathorcupc topic optimal design of heat dissipation for submarine data center
Is it safe to open a stock account on the compass?
Rxjs TakeUntil 操作符的学习笔记
Reasons for Meiye to choose membership system
Exception: gradle task assemblydebug failed with exit code 1