当前位置:网站首页>【大型电商项目开发】性能压测-优化-中间件对性能的影响-40
【大型电商项目开发】性能压测-优化-中间件对性能的影响-40
2022-07-05 00:59:00 【随意石光】
一:测试nginx对性能的影响
1.打开jmeter进行测试

- 将线程数修改为50,并且勾中永远,让其一直测试,除非手动停止
2.给nginx发送请求
给服务器的80端口发送请求,并添加如下汇总图
- 使用
docker stats查看docker容器使用情况
结论:nginx需要给其他服务频繁转发,所以使用消耗的线程多,内存小,cpu占用空间大
二:监控指标
1、中间件指标

- 当前正在运行的线程数不能超过设定的最大值。一般情况下系统性能较好的情况下,线 程数最小值设置 50 和最大值设置 200 比较合适。
- 当前运行的 JDBC 连接数不能超过设定的最大值。一般情况下系统性能较好的情况下, JDBC 最小值设置 50 和最大值设置 200 比较合适。
- GC频率不能频繁,特别是 FULL GC 更不能频繁,一般情况下系统性能较好的情况下, JVM 最小堆大小和最大堆大小分别设置 1024M 比较合适。
2、数据库指标

- SQL 耗时越小越好,一般情况下微秒级别。
- 命中率越高越好,一般情况下不能低于 95%。
- 锁等待次数越低越好,等待时间越短越好。
3、联合测试


- 中间件越多,性能损失越大,大多都损失在网络交互了;
- 业务:
Db(MySQL 优化)
模板的渲染速度(缓存)
静态资源
三:优化吞吐量
1.nginx实现动静分离
1)以后所有的静态资源都放在nginx里面
2)规则:/static/***所有请求都由nginx直接返回
3)搬家静态资源(将静态资源直接转移到服务器里面)
- 进入到HTML路径下
cd /mydata/nginx/html - 在HTML下新建static
mkdir static - 进入到static文件夹,并且将product的静态资源index复制进去(将本项目的静态资源删除)
- 在img,src,herf标签中加入/static/路径

2.修改服务器nginx的配置
1)进入到cd /mydata/nginx/conf/conf.d路径下
2)修改gulimail.conf文件 vi gulimail.conf
location /static/ {
root /usr/share/nginx/html;
}
边栏推荐
- 各大主流编程语言性能PK,结果出乎意料
- Multilingual Wikipedia website source code development part II
- Insert sort of sort
- Arbitrum:二维费用
- 2022.07.03 (lc_6111_counts the number of ways to place houses)
- Apifox (postman + swagger + mock + JMeter), an artifact of full stack development and efficiency improvement
- Reasons and solutions of redis cache penetration and avalanche
- 那些一门心思研究自动化测试的人,最后都怎样了?
- const、volatile和restrict的作用和用法总结
- [microprocessor] VHDL development of microprocessor based on FPGA
猜你喜欢

ORB(Oriented FAST and Rotated BRIEF)

What happened to those who focused on automated testing?

Inventory of more than 17 typical security incidents in January 2022

Operator explanation
![[wave modeling 1] theoretical analysis and MATLAB simulation of wave modeling](/img/c4/46663f64b97e7b25d7222de7025f59.png)
[wave modeling 1] theoretical analysis and MATLAB simulation of wave modeling

资深测试/开发程序员写下无bug?资历(枷锁)不要惧怕错误......

1189. Maximum number of "balloons"

pycharm专业版下载安装教程

NPM install error forced installation

leetcode494,474
随机推荐
Identifiers and keywords
Detailed explanation of openharmony resource management
两个数相互替换
Which financial products with stable income are good
【Unity】InputSystem
Basic concept and usage of redis
dotnet-exec 0.6.0 released
Huawei employs millions of data governance experts! The 100 billion market behind it deserves attention
POAP:NFT的采用入口?
PyTorch: In-place Operation
Research Report on the overall scale, major producers, major regions, products and application segmentation of agricultural automatic steering system in the global market in 2022
Innovation leads the direction. Huawei Smart Life launches new products in the whole scene
College degree, what about 33 year old Baoma? I still sell and test, and my monthly income is 13K+
7. Scala process control
FEG founder rox:smartdefi will be the benchmark of the entire decentralized financial market
Applet live + e-commerce, if you want to be a new retail e-commerce, use it!
Binary conversion problem
[selenium automation] common notes
资深测试/开发程序员写下无bug?资历(枷锁)不要惧怕错误......
[Yocto RM]11 - Features